parent::setUp();
self::$users['ApiQueryRecentChangesIntegrationTestUser'] = $this->getMutableTestUser();
- $this->doLogin( 'ApiQueryRecentChangesIntegrationTestUser' );
wfGetDB( DB_MASTER )->delete( 'recentchanges', '*', __METHOD__ );
}
$params
),
null,
- false
+ false,
+ $this->getLoggedInTestUser()
);
}
array_merge(
[ 'action' => 'query', 'generator' => 'recentchanges' ],
$params
- )
+ ),
+ null,
+ false,
+ $this->getLoggedInTestUser()
);
}
);
}
+ 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' );