Merge "Replace recently introduced mediawiki/at-ease calls"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 18 Apr 2018 18:56:32 +0000 (18:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 18 Apr 2018 18:56:32 +0000 (18:56 +0000)
12 files changed:
INSTALL
RELEASE-NOTES-1.31
composer.json
includes/Setup.php
includes/WebStart.php
includes/api/ApiMove.php
includes/installer/DatabaseUpdater.php
includes/parser/CacheTime.php
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
includes/parser/ParserOutput.php
tests/phpunit/includes/api/ApiMoveTest.php [new file with mode: 0644]

diff --git a/INSTALL b/INSTALL
index 1a59f0b..3b93505 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -9,7 +9,7 @@ Required software:
 * Web server with PHP 5.5.9 or higher.
 * A SQL server, the following types are supported
 ** MySQL 5.5.8 or higher
-** PostgreSQL 8.3 or higher
+** PostgreSQL 9.2 or higher
 ** SQLite 3.3.7 or higher
 ** Oracle 9.0.1 or higher
 ** Microsoft SQL Server 2005 (9.00.1399)
index 21b29cb..e91ff11 100644 (file)
@@ -104,7 +104,7 @@ production.
 * Updated wikimedia/running-stat from 1.1.0 to 1.2.0.
 * Updated wikimedia/wrappedstring from 2.2.0 to 2.3.0.
 * Updated mediawiki/at-ease from 1.1.0 to 1.2.0.
-* Updated wikimedia/php-session-serializer from 1.0.4 to 1.0.5.
+* Updated wikimedia/php-session-serializer from 1.0.4 to 1.0.6.
 * Updated wikimedia/remex-html from 1.0.2 to 1.0.3.
 * …
 
@@ -121,6 +121,7 @@ production.
   'mediawiki.viewport' module instead.
 * The deprecated 'mediawiki.widgets.CategorySelector' module alias was removed.
   Use the 'mediawiki.widgets.CategoryMultiselectWidget' module directly instead.
+* mediawiki/at-ease was replaced with wikimedia/at-ease.
 
 === Bug fixes in 1.31 ===
 * (T90902) Non-breaking space in header ID breaks anchor
@@ -129,6 +130,9 @@ production.
 * (T185058) The 'name' value to tgprop for action=query&list=tags has been
   removed. It has never made a difference in the output, the name was always
   returned regardless.
+* The 'watch' and 'unwatch' parameters for action=move have been removed.  They
+  were deprecated and also accidentally nonfunctional since 1.17 in 2010.  Use
+  'watchlist' instead.
 
 === Action API internal changes in 1.31 ===
 * ApiBase::getProfileDBTime was removed (deprecated since 1.25)
index ebc800a..98e4d49 100644 (file)
                "ext-mbstring": "*",
                "ext-xml": "*",
                "liuggio/statsd-php-client": "1.0.18",
-               "mediawiki/at-ease": "1.2.0",
                "oojs/oojs-ui": "v0.26.4",
                "oyejorge/less.php": "1.7.0.14",
                "php": ">=5.5.9",
                "psr/log": "1.0.2",
                "wikimedia/assert": "0.2.2",
+               "wikimedia/at-ease": "1.2.0",
                "wikimedia/base-convert": "1.0.1",
                "wikimedia/cdb": "1.4.1",
                "wikimedia/cldr-plural-rule-parser": "1.0.0",
@@ -37,7 +37,7 @@
                "wikimedia/html-formatter": "1.0.1",
                "wikimedia/ip-set": "1.2.0",
                "wikimedia/object-factory": "1.0.0",
-               "wikimedia/php-session-serializer": "1.0.5",
+               "wikimedia/php-session-serializer": "1.0.6",
                "wikimedia/purtle": "1.0.7",
                "wikimedia/relpath": "2.1.1",
                "wikimedia/remex-html": "1.0.3",
index 6513cdd..de7d59a 100644 (file)
@@ -37,6 +37,11 @@ if ( !defined( 'MEDIAWIKI' ) ) {
  * Pre-config setup: Before loading LocalSettings.php
  */
 
+// Sanity check (T5782, T122807)
+if ( ini_get( 'mbstring.func_overload' ) ) {
+       die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
+}
+
 // Start the autoloader, so that extensions can derive classes from core files
 require_once "$IP/includes/AutoLoader.php";
 
index b24ff7a..878dd3e 100644 (file)
  * @file
  */
 
-if ( ini_get( 'mbstring.func_overload' ) ) {
-       die( 'MediaWiki does not support installations where mbstring.func_overload is non-zero.' );
-}
-
 # T17461: Make IE8 turn off content sniffing. Everybody else should ignore this
 # We're adding it here so that it's *always* set, even for alternate entry
 # points and when $wgOut gets disabled or overridden.
index 2814564..f6b6b35 100644 (file)
@@ -99,7 +99,6 @@ class ApiMove extends ApiBase {
                // a redirect to the new title. This is not safe, but what we did before was
                // even worse: we just determined whether a redirect should have been created,
                // and reported that it was created if it should have, without any checks.
-               // Also note that isRedirect() is unreliable because of T39209.
                $r['redirectcreated'] = $fromTitle->exists();
 
                $r['moveoverredirect'] = $toTitleExists;
@@ -152,10 +151,6 @@ class ApiMove extends ApiBase {
                $watch = 'preferences';
                if ( isset( $params['watchlist'] ) ) {
                        $watch = $params['watchlist'];
-               } elseif ( $params['watch'] ) {
-                       $watch = 'watch';
-               } elseif ( $params['unwatch'] ) {
-                       $watch = 'unwatch';
                }
 
                // Watch pages
@@ -250,14 +245,6 @@ class ApiMove extends ApiBase {
                        'movetalk' => false,
                        'movesubpages' => false,
                        'noredirect' => false,
-                       'watch' => [
-                               ApiBase::PARAM_DFLT => false,
-                               ApiBase::PARAM_DEPRECATED => true,
-                       ],
-                       'unwatch' => [
-                               ApiBase::PARAM_DFLT => false,
-                               ApiBase::PARAM_DEPRECATED => true,
-                       ],
                        'watchlist' => [
                                ApiBase::PARAM_DFLT => 'preferences',
                                ApiBase::PARAM_TYPE => [
index 04132ad..ecd3081 100644 (file)
@@ -136,7 +136,7 @@ abstract class DatabaseUpdater {
                        $wgExtPGAlteredFields, $wgExtNewIndexes, $wgExtModifiedFields;
 
                # For extensions only, should be populated via hooks
-               # $wgDBtype should be checked to specifiy the proper file
+               # $wgDBtype should be checked to specify the proper file
                $wgExtNewTables = []; // table, dir
                $wgExtNewFields = []; // table, column, dir
                $wgExtPGNewFields = []; // table, column, column attributes; for PostgreSQL
index 05bcebe..26d5bdd 100644 (file)
  * @ingroup Parser
  */
 class CacheTime {
-       /** @var array|bool ParserOptions which have been taken into account to
-        * produce output or false if not available.
+       /**
+        * @var string[] ParserOptions which have been taken into account to produce output.
         */
        public $mUsedOptions;
 
-       # Compatibility check
+       /**
+        * @var string|null Compatibility check
+        */
        public $mVersion = Parser::VERSION;
 
-       # Time when this object was generated, or -1 for uncacheable. Used in ParserCache.
+       /**
+        * @var string|int TS_MW timestamp when this object was generated, or -1 for uncacheable. Used
+        * in ParserCache.
+        */
        public $mCacheTime = '';
 
-       # Seconds after which the object should expire, use 0 for uncacheable. Used in ParserCache.
+       /**
+        * @var int|null Seconds after which the object should expire, use 0 for uncacheable. Used in
+        * ParserCache.
+        */
        public $mCacheExpiry = null;
 
-       # Revision ID that was parsed
+       /**
+        * @var int|null Revision ID that was parsed
+        */
        public $mCacheRevisionId = null;
 
        /**
@@ -71,7 +81,7 @@ class CacheTime {
 
        /**
         * @since 1.23
-        * @param int $id Revision id
+        * @param int|null $id Revision ID
         */
        public function setCacheRevisionId( $id ) {
                $this->mCacheRevisionId = $id;
@@ -105,7 +115,7 @@ class CacheTime {
         * The value returned by getCacheExpiry is smaller or equal to the smallest number
         * that was provided to a call of updateCacheExpiry(), and smaller or equal to the
         * value of $wgParserCacheExpireTime.
-        * @return int|mixed|null
+        * @return int
         */
        public function getCacheExpiry() {
                global $wgParserCacheExpireTime;
index 8a7fca6..e6326e6 100644 (file)
@@ -291,8 +291,8 @@ class ParserCache {
         * @param ParserOutput $parserOutput
         * @param WikiPage $page
         * @param ParserOptions $popts
-        * @param string $cacheTime Time when the cache was generated
-        * @param int $revId Revision ID that was parsed
+        * @param string|null $cacheTime TS_MW timestamp when the cache was generated
+        * @param int|null $revId Revision ID that was parsed
         */
        public function save( $parserOutput, $page, $popts, $cacheTime = null, $revId = null ) {
                $expire = $parserOutput->getCacheExpiry();
index ff21ef0..8fb9857 100644 (file)
@@ -1211,7 +1211,7 @@ class ParserOptions {
         * in 1.16.
         * Used to get the old parser cache entries when available.
         * @deprecated since 1.30. You probably want self::allCacheVaryingOptions() instead.
-        * @return array
+        * @return string[]
         */
        public static function legacyOptions() {
                wfDeprecated( __METHOD__, '1.30' );
@@ -1268,7 +1268,7 @@ class ParserOptions {
         * the same cached data safely.
         *
         * @since 1.17
-        * @param array $forOptions
+        * @param string[] $forOptions
         * @param Title $title Used to get the content language of the page (since r97636)
         * @return string Page rendering hash
         */
index 8f0a1d7..f3a83db 100644 (file)
@@ -177,7 +177,7 @@ class ParserOutput extends CacheTime {
        private $mIndexPolicy = '';
 
        /**
-        * @var array $mAccessedOptions List of ParserOptions (stored in the keys).
+        * @var true[] $mAccessedOptions List of ParserOptions (stored in the keys).
         */
        private $mAccessedOptions = [];
 
@@ -685,9 +685,8 @@ class ParserOutput extends CacheTime {
        /**
         * Register a file dependency for this output
         * @param string $name Title dbKey
-        * @param string $timestamp MW timestamp of file creation (or false if non-existing)
-        * @param string $sha1 Base 36 SHA-1 of file (or false if non-existing)
-        * @return void
+        * @param string|false|null $timestamp MW timestamp of file creation (or false if non-existing)
+        * @param string|false|null $sha1 Base 36 SHA-1 of file (or false if non-existing)
         */
        public function addImage( $name, $timestamp = null, $sha1 = null ) {
                $this->mImages[$name] = 1;
@@ -701,7 +700,6 @@ class ParserOutput extends CacheTime {
         * @param Title $title
         * @param int $page_id
         * @param int $rev_id
-        * @return void
         */
        public function addTemplate( $title, $page_id, $rev_id ) {
                $ns = $title->getNamespace();
@@ -968,8 +966,8 @@ class ParserOutput extends CacheTime {
 
        /**
         * Returns the options from its ParserOptions which have been taken
-        * into account to produce this output or false if not available.
-        * @return array
+        * into account to produce this output.
+        * @return string[]
         */
        public function getUsedOptions() {
                if ( !isset( $this->mAccessedOptions ) ) {
diff --git a/tests/phpunit/includes/api/ApiMoveTest.php b/tests/phpunit/includes/api/ApiMoveTest.php
new file mode 100644 (file)
index 0000000..fb697ff
--- /dev/null
@@ -0,0 +1,393 @@
+<?php
+
+/**
+ * @group API
+ * @group Database
+ * @group medium
+ *
+ * @covers ApiMove
+ */
+class ApiMoveTest extends ApiTestCase {
+       /**
+        * @param string $from Prefixed name of source
+        * @param string $to Prefixed name of destination
+        * @param string $id Page id of the page to move
+        * @param array|string|null $opts Options: 'noredirect' to expect no redirect
+        */
+       protected function assertMoved( $from, $to, $id, $opts = null ) {
+               $opts = (array)$opts;
+
+               $fromTitle = Title::newFromText( $from );
+               $toTitle = Title::newFromText( $to );
+
+               $this->assertTrue( $toTitle->exists(),
+                       "Destination {$toTitle->getPrefixedText()} does not exist" );
+
+               if ( in_array( 'noredirect', $opts ) ) {
+                       $this->assertFalse( $fromTitle->exists(),
+                               "Source {$fromTitle->getPrefixedText()} exists" );
+               } else {
+                       $this->assertTrue( $fromTitle->exists(),
+                               "Source {$fromTitle->getPrefixedText()} does not exist" );
+                       $this->assertTrue( $fromTitle->isRedirect(),
+                               "Source {$fromTitle->getPrefixedText()} is not a redirect" );
+
+                       $target = Revision::newFromTitle( $fromTitle )->getContent()->getRedirectTarget();
+                       $this->assertSame( $toTitle->getPrefixedText(), $target->getPrefixedText() );
+               }
+
+               $this->assertSame( $id, $toTitle->getArticleId() );
+       }
+
+       /**
+        * Shortcut function to create a page and return its id.
+        *
+        * @param string $name Page to create
+        * @return int ID of created page
+        */
+       protected function createPage( $name ) {
+               return $this->editPage( $name, 'Content' )->value['revision']->getPage();
+       }
+
+       public function testFromWithFromid() {
+               $this->setExpectedException( ApiUsageException::class,
+                       'The parameters "from" and "fromid" can not be used together.' );
+
+               $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => 'Some page',
+                       'fromid' => 123,
+                       'to' => 'Some other page',
+               ] );
+       }
+
+       public function testMove() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveById() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'fromid' => $id,
+                       'to' => "$name 2",
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveNonexistent() {
+               $this->setExpectedException( ApiUsageException::class,
+                       "The page you specified doesn't exist." );
+
+               $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => 'Nonexistent page',
+                       'to' => 'Different page'
+               ] );
+       }
+
+       public function testMoveNonexistentId() {
+               $this->setExpectedException( ApiUsageException::class,
+                       'There is no page with ID 2147483647.' );
+
+               $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'fromid' => pow( 2, 31 ) - 1,
+                       'to' => 'Different page',
+               ] );
+       }
+
+       public function testMoveToInvalidPageName() {
+               $this->setExpectedException( ApiUsageException::class, 'Bad title "[".' );
+
+               $name = ucfirst( __FUNCTION__ );
+               $id = $this->createPage( $name );
+
+               try {
+                       $this->doApiRequestWithToken( [
+                               'action' => 'move',
+                               'from' => $name,
+                               'to' => '[',
+                       ] );
+               } finally {
+                       $this->assertSame( $id, Title::newFromText( $name )->getArticleId() );
+               }
+       }
+
+       // @todo File moving
+
+       public function testPingLimiter() {
+               global $wgRateLimits;
+
+               $this->setExpectedException( ApiUsageException::class,
+                       "You've exceeded your rate limit. Please wait some time and try again." );
+
+               $name = ucfirst( __FUNCTION__ );
+
+               $this->setMwGlobals( 'wgMainCacheType', 'hash' );
+
+               $this->stashMwGlobals( 'wgRateLimits' );
+               $wgRateLimits['move'] = [ '&can-bypass' => false, 'user' => [ 1, 60 ] ];
+
+               $id = $this->createPage( $name );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+
+               try {
+                       $this->doApiRequestWithToken( [
+                               'action' => 'move',
+                               'from' => "$name 2",
+                               'to' => "$name 3",
+                       ] );
+               } finally {
+                       $this->assertSame( $id, Title::newFromText( "$name 2" )->getArticleId() );
+                       $this->assertFalse( Title::newFromText( "$name 3" )->exists(),
+                               "\"$name 3\" should not exist" );
+               }
+       }
+
+       public function testTagsNoPermission() {
+               $this->setExpectedException( ApiUsageException::class,
+                       'You do not have permission to apply change tags along with your changes.' );
+
+               $name = ucfirst( __FUNCTION__ );
+
+               ChangeTags::defineTag( 'custom tag' );
+
+               $this->setGroupPermissions( 'user', 'applychangetags', false );
+
+               $id = $this->createPage( $name );
+
+               try {
+                       $this->doApiRequestWithToken( [
+                               'action' => 'move',
+                               'from' => $name,
+                               'to' => "$name 2",
+                               'tags' => 'custom tag',
+                       ] );
+               } finally {
+                       $this->assertSame( $id, Title::newFromText( $name )->getArticleId() );
+                       $this->assertFalse( Title::newFromText( "$name 2" )->exists(),
+                               "\"$name 2\" should not exist" );
+               }
+       }
+
+       public function testSelfMove() {
+               $this->setExpectedException( ApiUsageException::class,
+                       'The title is the same; cannot move a page over itself.' );
+
+               $name = ucfirst( __FUNCTION__ );
+               $this->createPage( $name );
+
+               $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => $name,
+               ] );
+       }
+
+       public function testMoveTalk() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+               $talkId = $this->createPage( "Talk:$name" );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+                       'movetalk' => '',
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertMoved( "Talk:$name", "Talk:$name 2", $talkId );
+
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveTalkFailed() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+               $talkId = $this->createPage( "Talk:$name" );
+               $talkDestinationId = $this->createPage( "Talk:$name 2" );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+                       'movetalk' => '',
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertSame( $talkId, Title::newFromText( "Talk:$name" )->getArticleId() );
+               $this->assertSame( $talkDestinationId,
+                       Title::newFromText( "Talk:$name 2" )->getArticleId() );
+               $this->assertSame( [ [
+                       'message' => 'articleexists',
+                       'params' => [],
+                       'code' => 'articleexists',
+                       'type' => 'error',
+               ] ], $res[0]['move']['talkmove-errors'] );
+
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveSubpages() {
+               global $wgNamespacesWithSubpages;
+
+               $name = ucfirst( __FUNCTION__ );
+
+               $this->stashMwGlobals( 'wgNamespacesWithSubpages' );
+               $wgNamespacesWithSubpages[NS_MAIN] = true;
+
+               $pages = [ $name, "$name/1", "$name/2", "Talk:$name", "Talk:$name/1", "Talk:$name/3" ];
+               $ids = [];
+               foreach ( array_merge( $pages, [ "$name/error", "$name 2/error" ] ) as $page ) {
+                       $ids[$page] = $this->createPage( $page );
+               }
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+                       'movetalk' => '',
+                       'movesubpages' => '',
+               ] );
+
+               foreach ( $pages as $page ) {
+                       $this->assertMoved( $page, str_replace( $name, "$name 2", $page ), $ids[$page] );
+               }
+
+               $this->assertSame( $ids["$name/error"],
+                       Title::newFromText( "$name/error" )->getArticleId() );
+               $this->assertSame( $ids["$name 2/error"],
+                       Title::newFromText( "$name 2/error" )->getArticleId() );
+
+               $results = array_merge( $res[0]['move']['subpages'], $res[0]['move']['subpages-talk'] );
+               foreach ( $results as $arr ) {
+                       if ( $arr['from'] === "$name/error" ) {
+                               $this->assertSame( [ [
+                                       'message' => 'articleexists',
+                                       'params' => [],
+                                       'code' => 'articleexists',
+                                       'type' => 'error'
+                               ] ], $arr['errors'] );
+                       } else {
+                               $this->assertSame( str_replace( $name, "$name 2", $arr['from'] ), $arr['to'] );
+                       }
+                       $this->assertCount( 2, $arr );
+               }
+
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveNoPermission() {
+               $this->setExpectedException( ApiUsageException::class,
+                       'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.' );
+
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+
+               $user = new User();
+
+               try {
+                       $this->doApiRequestWithToken( [
+                               'action' => 'move',
+                               'from' => $name,
+                               'to' => "$name 2",
+                       ], null, $user );
+               } finally {
+                       $this->assertSame( $id, Title::newFromText( "$name" )->getArticleId() );
+                       $this->assertFalse( Title::newFromText( "$name 2" )->exists(),
+                               "\"$name 2\" should not exist" );
+               }
+       }
+
+       public function testSuppressRedirect() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $id = $this->createPage( $name );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+                       'noredirect' => '',
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id, 'noredirect' );
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testSuppressRedirectNoPermission() {
+               $name = ucfirst( __FUNCTION__ );
+
+               $this->setGroupPermissions( 'sysop', 'suppressredirect', false );
+
+               $id = $this->createPage( $name );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => $name,
+                       'to' => "$name 2",
+                       'noredirect' => '',
+               ] );
+
+               $this->assertMoved( $name, "$name 2", $id );
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+
+       public function testMoveSubpagesError() {
+               $name = ucfirst( __FUNCTION__ );
+
+               // Subpages are allowed in talk but not main
+               $idBase = $this->createPage( "Talk:$name" );
+               $idSub = $this->createPage( "Talk:$name/1" );
+
+               $res = $this->doApiRequestWithToken( [
+                       'action' => 'move',
+                       'from' => "Talk:$name",
+                       'to' => $name,
+                       'movesubpages' => '',
+               ] );
+
+               $this->assertMoved( "Talk:$name", $name, $idBase );
+               $this->assertSame( $idSub, Title::newFromText( "Talk:$name/1" )->getArticleId() );
+               $this->assertFalse( Title::newFromText( "$name/1" )->exists(),
+                       "\"$name/1\" should not exist" );
+
+               $this->assertSame( [ 'errors' => [ [
+                       'message' => 'namespace-nosubpages',
+                       'params' => [ '' ],
+                       'code' => 'namespace-nosubpages',
+                       'type' => 'error',
+               ] ] ], $res[0]['move']['subpages'] );
+
+               $this->assertArrayNotHasKey( 'warnings', $res[0] );
+       }
+}