Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387788 )

Change subject: Always supplay an Article when constructing an Action.
......................................................................

Always supplay an Article when constructing an Action.

This is required for compatibility with I0335100b2bb.

Change-Id: Icf6055feb2a12f60017cbfdb45c9835ddc9b50b3
---
M 
client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
M repo/includes/Actions/HistoryEntityAction.php
2 files changed, 21 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/88/387788/1

diff --git 
a/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
 
b/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
index e4099ee..cb53f84 100644
--- 
a/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
+++ 
b/client/tests/phpunit/includes/Hooks/SkinTemplateOutputPageBeforeExecHandlerTest.php
@@ -3,6 +3,7 @@
 namespace Wikibase\Client\Tests\Hooks;
 
 use ConfigFactory;
+use ContentHandler;
 use FauxRequest;
 use IContextSource;
 use OutputPage;
@@ -139,11 +140,7 @@
                $output = new OutputPage( $this->getContext() );
                $output->setProperty( 'noexternallanglinks', 
$noexternallanglinks );
                $output->setProperty( 'wikibase_item', 'Q2013' );
-
-               $title = $this->getMock( Title::class );
-               $title->expects( $this->any() )
-                       ->method( 'exists' )
-                       ->will( $this->returnValue( true ) );
+               $title = $output->getTitle();
 
                $skin->expects( $this->any() )
                        ->method( 'getOutput' )
@@ -164,12 +161,25 @@
        private function getContext() {
                $request = new FauxRequest( [ 'action' => 'view' ] );
 
+               $title = $this->getMock( Title::class );
+               $title->expects( $this->any() )
+                       ->method( 'exists' )
+                       ->will( $this->returnValue( true ) );
+
+               $contentHandler = ContentHandler::getForModelID( 
CONTENT_MODEL_WIKITEXT );
+
                $wikiPage = $this->getMockBuilder( WikiPage::class )
                        ->disableOriginalConstructor()
                        ->getMock();
                $wikiPage->expects( $this->any() )
                        ->method( 'getActionOverrides' )
                        ->will( $this->returnValue( [] ) );
+               $wikiPage->expects( $this->any() )
+                       ->method( 'getContentHandler' )
+                       ->will( $this->returnValue( $contentHandler ) );
+               $wikiPage->expects( $this->any() )
+                       ->method( 'getTitle' )
+                       ->will( $this->returnValue( $title ) );
 
                $context = $this->getMock( IContextSource::class );
                $context->expects( $this->any() )
@@ -182,6 +192,9 @@
                        ->method( 'getRequest' )
                        ->will( $this->returnValue( $request ) );
                $context->expects( $this->any() )
+                       ->method( 'getTitle' )
+                       ->will( $this->returnValue( $title ) );
+               $context->expects( $this->any() )
                        ->method( 'getConfig' )
                        ->will( $this->returnValue(
                                
ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
diff --git a/repo/includes/Actions/HistoryEntityAction.php 
b/repo/includes/Actions/HistoryEntityAction.php
index b572bfd..770582f 100644
--- a/repo/includes/Actions/HistoryEntityAction.php
+++ b/repo/includes/Actions/HistoryEntityAction.php
@@ -2,9 +2,9 @@
 
 namespace Wikibase;
 
+use Article;
 use HistoryAction;
 use IContextSource;
-use Page;
 use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
 use Wikibase\Store\EntityIdLookup;
 
@@ -28,13 +28,13 @@
        private $labelLookup;
 
        /**
-        * @param Page $page
+        * @param Article $page
         * @param IContextSource|null $context
         * @param EntityIdLookup $entityIdLookup
         * @param LabelDescriptionLookup $labelLookup
         */
        public function __construct(
-               Page $page,
+               Article $page,
                IContextSource $context = null,
                EntityIdLookup $entityIdLookup,
                LabelDescriptionLookup $labelLookup

-- 
To view, visit https://gerrit.wikimedia.org/r/387788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf6055feb2a12f60017cbfdb45c9835ddc9b50b3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to