X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fwatcheditem%2FWatchedItemQueryServiceUnitTest.php;h=16f236770c2f3e534f59ee00e5136ecbc1310358;hb=d67e78d821266144e01e5f896fb2c99ac39764de;hp=be51626a6f387dfd6b690d13b83008af51454288;hpb=0c2687f44eb0e8c7f480b7303f89056682ba0bfb;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php b/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php index be51626a6f..16f236770c 100644 --- a/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php +++ b/tests/phpunit/includes/watcheditem/WatchedItemQueryServiceUnitTest.php @@ -72,7 +72,8 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { return new WatchedItemQueryService( $this->getMockLoadBalancer( $mockDb ), $this->getMockCommentStore(), - $this->getMockActorMigration() + $this->getMockActorMigration(), + $this->getMockWatchedItemStore() ); } @@ -139,6 +140,22 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { return $mock; } + /** + * @param PHPUnit_Framework_MockObject_MockObject|Database $mockDb + * @return PHPUnit_Framework_MockObject_MockObject|WatchedItemStore + */ + private function getMockWatchedItemStore() { + $mock = $this->getMockBuilder( WatchedItemStore::class ) + ->disableOriginalConstructor() + ->getMock(); + $mock->expects( $this->any() ) + ->method( 'getLatestNotificationTimestamp' ) + ->will( $this->returnCallback( function ( $timestamp ) { + return $timestamp; + } ) ); + return $mock; + } + /** * @param int $id * @return PHPUnit_Framework_MockObject_MockObject|User @@ -263,7 +280,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { ], [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' @@ -386,7 +403,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { ], [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' @@ -776,7 +793,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { null, [], [], - [ 'rc_patrolled = 0' ], + [ 'rc_patrolled' => 0 ], [], [], ], @@ -888,7 +905,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { $expectedJoinConds = array_merge( [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' @@ -1121,7 +1138,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { $this->isType( 'string' ), $this->isType( 'array' ), array_merge( [ - 'watchlist' => [ 'INNER JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' ] ], + 'watchlist' => [ 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' ] ], 'page' => [ 'LEFT JOIN', 'rc_cur_id=page_id' ], ], $expectedExtraJoins ) ) @@ -1159,7 +1176,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { [], [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' @@ -1282,7 +1299,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { [], [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title' @@ -1328,7 +1345,7 @@ class WatchedItemQueryServiceUnitTest extends MediaWikiTestCase { [], [ 'watchlist' => [ - 'INNER JOIN', + 'JOIN', [ 'wl_namespace=rc_namespace', 'wl_title=rc_title'