Merge "Revert "Log the reason why revision->getContent() returns null""
[lhc/web/wiklou.git] / tests / phpunit / includes / title / SubpageImportTitleFactoryTest.php
index d5c17f3..008cf5d 100644 (file)
@@ -29,39 +29,39 @@ class SubpageImportTitleFactoryTest extends MediaWikiTestCase {
        protected function setUp() {
                parent::setUp();
 
-               $this->setMwGlobals( array(
+               $this->setMwGlobals( [
                        'wgLanguageCode' => 'en',
                        'wgContLang' => Language::factory( 'en' ),
-                       'wgNamespacesWithSubpages' => array( 0 => false, 2 => true ),
-               ) );
+                       'wgNamespacesWithSubpages' => [ 0 => false, 2 => true ],
+               ] );
        }
 
        public function basicProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                new ForeignTitle( 0, '', 'MainNamespaceArticle' ),
                                Title::newFromText( 'User:Graham' ),
                                Title::newFromText( 'User:Graham/MainNamespaceArticle' )
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 1, 'Discussion', 'Nice_talk' ),
                                Title::newFromText( 'User:Graham' ),
                                Title::newFromText( 'User:Graham/Discussion:Nice_talk' )
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 0, '', 'Bogus:Nice_talk' ),
                                Title::newFromText( 'User:Graham' ),
                                Title::newFromText( 'User:Graham/Bogus:Nice_talk' )
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @dataProvider basicProvider
         */
        public function testBasic( ForeignTitle $foreignTitle, Title $rootPage,
-               Title $title ) {
-
+               Title $title
+       ) {
                $factory = new SubpageImportTitleFactory( $rootPage );
                $testTitle = $factory->createTitleFromForeignTitle( $foreignTitle );
 
@@ -69,18 +69,18 @@ class SubpageImportTitleFactoryTest extends MediaWikiTestCase {
        }
 
        public function failureProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                Title::newFromText( 'Graham' ),
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @dataProvider failureProvider
         */
        public function testFailures( Title $rootPage ) {
-               $this->setExpectedException( 'MWException' );
+               $this->setExpectedException( MWException::class );
                new SubpageImportTitleFactory( $rootPage );
        }
 }