Merge branch 'Wikidata' into master.
[lhc/web/wiklou.git] / tests / phpunit / includes / api / ApiWatchTest.php
index cc6c587..b7ae292 100644 (file)
@@ -29,7 +29,7 @@ class ApiWatchTest extends ApiTestCase {
 
                $data = $this->doApiRequest( array(
                        'action' => 'edit',
-                       'title' => 'UTPage',
+                       'title' => 'Help:UTPage', // Help namespace is hopefully wikitext
                        'text' => 'new text',
                        'token' => $pageinfo['edittoken'],
                        'watchlist' => 'watch' ) );
@@ -81,7 +81,7 @@ class ApiWatchTest extends ApiTestCase {
                $data = $this->doApiRequest( array(
                        'action' => 'protect',
                        'token' => $pageinfo['protecttoken'],
-                       'title' => 'UTPage',
+                       'title' => 'Help:UTPage',
                        'protections' => 'edit=sysop',
                        'watchlist' => 'unwatch' ) );
 
@@ -97,14 +97,14 @@ class ApiWatchTest extends ApiTestCase {
 
                $pageinfo = $this->getTokens();
 
-               if ( !Title::newFromText( 'UTPage' )->exists() ) {
-                       $this->markTestSkipped( "The article [[UTPage]] does not exist" ); //TODO: just create it?
+               if ( !Title::newFromText( 'Help:UTPage' )->exists() ) {
+                       $this->markTestSkipped( "The article [[Help:UTPage]] does not exist" ); //TODO: just create it?
                }
 
                $data = $this->doApiRequest( array(
                        'action' => 'query',
                        'prop' => 'revisions',
-                       'titles' => 'UTPage',
+                       'titles' => 'Help:UTPage',
                        'rvtoken' => 'rollback' ) );
 
                $this->assertArrayHasKey( 'query', $data[0] );
@@ -113,7 +113,7 @@ class ApiWatchTest extends ApiTestCase {
                $key = array_pop( $keys );
 
                if ( isset( $data[0]['query']['pages'][$key]['missing'] ) ) {
-                       $this->markTestSkipped( "Target page (UTPage) doesn't exist" );
+                       $this->markTestSkipped( "Target page (Help:UTPage) doesn't exist" );
                }
 
                $this->assertArrayHasKey( 'pageid', $data[0]['query']['pages'][$key] );
@@ -139,7 +139,7 @@ class ApiWatchTest extends ApiTestCase {
                try {
                        $data = $this->doApiRequest( array(
                                'action' => 'rollback',
-                               'title' => 'UTPage',
+                               'title' => 'Help:UTPage',
                                'user' => $revinfo['user'],
                                'token' => $pageinfo['rollbacktoken'],
                                'watchlist' => 'watch' ) );
@@ -148,7 +148,7 @@ class ApiWatchTest extends ApiTestCase {
                        $this->assertArrayHasKey( 'title', $data[0]['rollback'] );
                } catch( UsageException $ue ) {
                        if( $ue->getCodeString() == 'onlyauthor' ) {
-                               $this->markTestIncomplete( "Only one author to 'UTPage', cannot test rollback" );
+                               $this->markTestIncomplete( "Only one author to 'Help:UTPage', cannot test rollback" );
                        } else {
                                $this->fail( "Received error '" . $ue->getCodeString() . "'" );
                        }
@@ -163,7 +163,7 @@ class ApiWatchTest extends ApiTestCase {
                $data = $this->doApiRequest( array(
                        'action' => 'delete',
                        'token' => $pageinfo['deletetoken'],
-                       'title' => 'UTPage' ) );
+                       'title' => 'Help:UTPage' ) );
                $this->assertArrayHasKey( 'delete', $data[0] );
                $this->assertArrayHasKey( 'title', $data[0]['delete'] );