X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fapi%2FApiQueryRecentChangesIntegrationTest.php;h=a95d5c1c0b5420ec6880b84e8c84713efb2e4720;hp=19f66fa9f80dcaade32541e591e2e7419ce0cbc6;hb=b37772a99128afe1699a60718ebe2a6f8469aa8f;hpb=d7148fe3b8c74e6f11dff0193ea9c5a18dc137cb diff --git a/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php b/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php index 19f66fa9f8..a95d5c1c0b 100644 --- a/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php +++ b/tests/phpunit/includes/api/ApiQueryRecentChangesIntegrationTest.php @@ -23,7 +23,6 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { parent::setUp(); self::$users['ApiQueryRecentChangesIntegrationTestUser'] = $this->getMutableTestUser(); - $this->doLogin( 'ApiQueryRecentChangesIntegrationTestUser' ); wfGetDB( DB_MASTER )->delete( 'recentchanges', '*', __METHOD__ ); } @@ -129,7 +128,8 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { $params ), null, - false + false, + $this->getLoggedInTestUser() ); } @@ -138,7 +138,10 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { array_merge( [ 'action' => 'query', 'generator' => 'recentchanges' ], $params - ) + ), + null, + false, + $this->getLoggedInTestUser() ); } @@ -589,7 +592,7 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { 'rc_minor' => 0, 'rc_cur_id' => $title->getArticleID(), 'rc_user' => 0, - 'rc_user_text' => 'External User', + 'rc_user_text' => 'm>External User', 'rc_comment' => '', 'rc_comment_text' => '', 'rc_comment_data' => null, @@ -860,6 +863,65 @@ class ApiQueryRecentChangesIntegrationTest extends ApiTestCase { ); } + public function testTitleParams() { + $page1 = new TitleValue( 0, 'ApiQueryRecentChangesIntegrationTestPage' ); + $page2 = new TitleValue( 1, 'ApiQueryRecentChangesIntegrationTestPage2' ); + $page3 = new TitleValue( 0, 'ApiQueryRecentChangesIntegrationTestPage3' ); + $this->doPageEdits( + $this->getLoggedInTestUser(), + [ + [ + 'target' => $page1, + 'summary' => 'Create the page', + ], + [ + 'target' => $page2, + 'summary' => 'Create the page', + ], + [ + 'target' => $page3, + 'summary' => 'Create the page', + ], + ] + ); + + $result = $this->doListRecentChangesRequest( + [ + 'rctitle' => 'ApiQueryRecentChangesIntegrationTestPage', + 'rcprop' => 'title' + ] + ); + + $result2 = $this->doListRecentChangesRequest( + [ + 'rctitle' => 'Talk:ApiQueryRecentChangesIntegrationTestPage2', + 'rcprop' => 'title' + ] + ); + + $this->assertEquals( + [ + [ + 'type' => 'new', + 'ns' => $page1->getNamespace(), + 'title' => $this->getPrefixedText( $page1 ) + ], + ], + $this->getItemsFromApiResponse( $result ) + ); + + $this->assertEquals( + [ + [ + 'type' => 'new', + 'ns' => $page2->getNamespace(), + 'title' => $this->getPrefixedText( $page2 ) + ], + ], + $this->getItemsFromApiResponse( $result2 ) + ); + } + public function testStartEndParams() { $target = new TitleValue( 0, 'ApiQueryRecentChangesIntegrationTestPage' ); $this->doPageEdit( $this->getLoggedInTestUser(), $target, 'Create the page' );