build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
[lhc/web/wiklou.git] / tests / phpunit / includes / WikiReferenceTest.php
index 308851a..e4b21ce 100644 (file)
@@ -3,17 +3,18 @@
 /**
  * @covers WikiReference
  */
+class WikiReferenceTest extends PHPUnit\Framework\TestCase {
 
-class WikiReferenceTest extends PHPUnit_Framework_TestCase {
+       use MediaWikiCoversValidator;
 
        public function provideGetDisplayName() {
-               return array(
-                       'http' => array( 'foo.bar', 'http://foo.bar' ),
-                       'https' => array( 'foo.bar', 'http://foo.bar' ),
+               return [
+                       'http' => [ 'foo.bar', 'http://foo.bar' ],
+                       'https' => [ 'foo.bar', 'http://foo.bar' ],
 
                        // apparently, this is the expected behavior
-                       'invalid' => array( 'purple kittens', 'purple kittens' ),
-               );
+                       'invalid' => [ 'purple kittens', 'purple kittens' ],
+               ];
        }
 
        /**
@@ -30,62 +31,64 @@ class WikiReferenceTest extends PHPUnit_Framework_TestCase {
        }
 
        public function provideGetCanonicalUrl() {
-               return array(
-                       'no fragement' => array(
+               return [
+                       'no fragment' => [
                                'https://acme.com/wiki/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                null
-                       ),
-                       'empty fragement' => array(
+                       ],
+                       'empty fragment' => [
                                'https://acme.com/wiki/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                ''
-                       ),
-                       'fragment' => array(
+                       ],
+                       'fragment' => [
                                'https://acme.com/wiki/Foo#Bar',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                'Bar'
-                       ),
-                       'double fragment' => array(
+                       ],
+                       'double fragment' => [
                                'https://acme.com/wiki/Foo#Bar%23Xus',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                'Bar#Xus'
-                       ),
-                       'escaped fragement' => array(
+                       ],
+                       'escaped fragment' => [
                                'https://acme.com/wiki/Foo%23Bar',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo#Bar',
                                null
-                       ),
-                       'empty path' => array(
+                       ],
+                       'empty path' => [
                                'https://acme.com/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/$1',
                                'Foo',
                                null
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @dataProvider provideGetCanonicalUrl
         */
-       public function testGetCanonicalUrl( $expected, $canonicalServer, $server, $path, $page, $fragmentId ) {
+       public function testGetCanonicalUrl(
+               $expected, $canonicalServer, $server, $path, $page, $fragmentId
+       ) {
                $reference = new WikiReference( $canonicalServer, $path, $server );
                $this->assertEquals( $expected, $reference->getCanonicalUrl( $page, $fragmentId ) );
        }
@@ -100,56 +103,56 @@ class WikiReferenceTest extends PHPUnit_Framework_TestCase {
        }
 
        public function provideGetFullUrl() {
-               return array(
-                       'no fragement' => array(
+               return [
+                       'no fragment' => [
                                '//acme.com/wiki/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                null
-                       ),
-                       'empty fragement' => array(
+                       ],
+                       'empty fragment' => [
                                '//acme.com/wiki/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                ''
-                       ),
-                       'fragment' => array(
+                       ],
+                       'fragment' => [
                                '//acme.com/wiki/Foo#Bar',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                'Bar'
-                       ),
-                       'double fragment' => array(
+                       ],
+                       'double fragment' => [
                                '//acme.com/wiki/Foo#Bar%23Xus',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo',
                                'Bar#Xus'
-                       ),
-                       'escaped fragement' => array(
+                       ],
+                       'escaped fragment' => [
                                '//acme.com/wiki/Foo%23Bar',
                                'https://acme.com',
                                '//acme.com',
                                '/wiki/$1',
                                'Foo#Bar',
                                null
-                       ),
-                       'empty path' => array(
+                       ],
+                       'empty path' => [
                                '//acme.com/Foo',
                                'https://acme.com',
                                '//acme.com',
                                '/$1',
                                'Foo',
                                null
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**