Merge "Revert "selenium: add new message banner test to user spec""
[lhc/web/wiklou.git] / tests / phpunit / includes / title / ForeignTitleTest.php
index 10b7e28..f2fccc7 100644 (file)
 class ForeignTitleTest extends MediaWikiTestCase {
 
        public function basicProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                new ForeignTitle( 20, 'Contributor', 'JohnDoe' ),
                                20, 'Contributor', 'JohnDoe'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( '1', 'Discussion', 'Capital' ),
                                1, 'Discussion', 'Capital'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 0, '', 'MainNamespace' ),
                                0, '', 'MainNamespace'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 4, 'Some ns', 'Article title with spaces' ),
                                4, 'Some_ns', 'Article_title_with_spaces'
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @dataProvider basicProvider
         */
        public function testBasic( ForeignTitle $title, $expectedId, $expectedName,
-               $expectedText ) {
-
+               $expectedText
+       ) {
                $this->assertEquals( true, $title->isNamespaceIdKnown() );
                $this->assertEquals( $expectedId, $title->getNamespaceId() );
                $this->assertEquals( $expectedName, $title->getNamespaceName() );
@@ -68,30 +68,30 @@ class ForeignTitleTest extends MediaWikiTestCase {
        }
 
        public function testUnknownNamespaceError() {
-               $this->setExpectedException( 'MWException' );
+               $this->setExpectedException( MWException::class );
                $title = new ForeignTitle( null, 'this', 'that' );
                $title->getNamespaceId();
        }
 
        public function fullTextProvider() {
-               return array(
-                       array(
+               return [
+                       [
                                new ForeignTitle( 20, 'Contributor', 'JohnDoe' ),
                                'Contributor:JohnDoe'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( '1', 'Discussion', 'Capital' ),
                                'Discussion:Capital'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 0, '', 'MainNamespace' ),
                                'MainNamespace'
-                       ),
-                       array(
+                       ],
+                       [
                                new ForeignTitle( 4, 'Some ns', 'Article title with spaces' ),
                                'Some_ns:Article_title_with_spaces'
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**