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

Change subject: Make unit tests aware of PageIdentity.
......................................................................

Make unit tests aware of PageIdentity.

Use of PageIdentity is protected by a method_exists check for now,
until Id36fb61986d is merged into core. We need this change beforehand though,
since without it the affected tests fail on Id36fb61986d.

Change-Id: I6eff5d3a54311b59411216034d28d07d1cc95792
---
M repo/tests/phpunit/includes/Content/EntityHandlerTest.php
1 file changed, 10 insertions(+), 2 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/Content/EntityHandlerTest.php 
b/repo/tests/phpunit/includes/Content/EntityHandlerTest.php
index 26d13c4..2e14f32 100644
--- a/repo/tests/phpunit/includes/Content/EntityHandlerTest.php
+++ b/repo/tests/phpunit/includes/Content/EntityHandlerTest.php
@@ -11,6 +11,7 @@
 use InvalidArgumentException;
 use Language;
 use LogicException;
+use MediaWiki\Storage\PageIdentityValue;
 use MWException;
 use PHPUnit_Framework_MockObject_MockObject;
 use RequestContext;
@@ -240,12 +241,19 @@
                $title->method( 'exists' )
                        ->will( $this->returnValue( true ) );
 
-               $title->method( 'getArticleId' )
+               $title->method( 'getArticleID' )
                        ->will( $this->returnValue( $id ) );
 
-               $title->method( 'getLatestRevId' )
+               $title->method( 'getLatestRevID' )
                        ->will( $this->returnValue( $id ) );
 
+               // TODO: remove conditional as soon as Title::getPageIdentity() 
is in core.
+               if ( method_exists( Title::class, 'getPageIdentity' ) ) {
+                       $page = PageIdentityValue::newFromDBKey( $id, NS_MAIN, 
__CLASS__ );
+                       $title->method( 'getPageIdentity' )
+                               ->will( $this->returnValue( $page ) );
+               }
+
                $revision = new Revision( [
                        'id' => $id,
                        'title' => $title,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6eff5d3a54311b59411216034d28d07d1cc95792
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to