X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FOutputPageTest.php;h=88c585fe5cfc8202b10516a1aab7e875ff10ed21;hb=7b95c9e1842aabc190812794a1ceaaca142a4141;hp=d29c79de848c71e8da34ab8fbd64aab0d449e8c8;hpb=dd54a41166d697185048e1beb9d407003c8e39a6;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index d29c79de84..88c585fe5c 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -266,15 +266,15 @@ class OutputPageTest extends MediaWikiTestCase { 'UploadPath' => $uploadPath, ] ); - MediaWiki\suppressWarnings(); + Wikimedia\suppressWarnings(); $actual = OutputPage::transformResourcePath( $conf, $path ); - MediaWiki\restoreWarnings(); + Wikimedia\restoreWarnings(); $this->assertEquals( $expected ?: $path, $actual ); } public static function provideMakeResourceLoaderLink() { - // @codingStandardsIgnoreStart Generic.Files.LineLength + // phpcs:disable Generic.Files.LineLength return [ // Single only=scripts load [ @@ -297,7 +297,7 @@ class OutputPageTest extends MediaWikiTestCase { . "});" ], ]; - // @codingStandardsIgnoreEnd + // phpcs:enable } /** @@ -311,7 +311,7 @@ class OutputPageTest extends MediaWikiTestCase { 'wgResourceLoaderDebug' => false, 'wgLoadScript' => 'http://127.0.0.1:8080/w/load.php', ] ); - $class = new ReflectionClass( 'OutputPage' ); + $class = new ReflectionClass( OutputPage::class ); $method = $class->getMethod( 'makeResourceLoaderLink' ); $method->setAccessible( true ); $ctx = new RequestContext(); @@ -345,6 +345,7 @@ class OutputPageTest extends MediaWikiTestCase { } public static function provideBuildExemptModules() { + // phpcs:disable Generic.Files.LineLength return [ 'empty' => [ 'exemptStyleModules' => [], @@ -354,7 +355,6 @@ class OutputPageTest extends MediaWikiTestCase { 'exemptStyleModules' => [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ], '', ], - // @codingStandardsIgnoreStart Generic.Files.LineLength 'default logged-out' => [ 'exemptStyleModules' => [ 'site' => [ 'site.styles' ] ], '' . "\n" . @@ -377,8 +377,8 @@ class OutputPageTest extends MediaWikiTestCase { '' . "\n" . '', ], - // @codingStandardsIgnoreEnd Generic.Files.LineLength ]; + // phpcs:enable } /** @@ -398,7 +398,7 @@ class OutputPageTest extends MediaWikiTestCase { $ctx = new RequestContext(); $ctx->setSkin( SkinFactory::getDefaultInstance()->makeSkin( 'fallback' ) ); $ctx->setLanguage( 'en' ); - $outputPage = $this->getMockBuilder( 'OutputPage' ) + $outputPage = $this->getMockBuilder( OutputPage::class ) ->setConstructorArgs( [ $ctx ] ) ->setMethods( [ 'isUserCssPreview', 'buildCssLinksArray' ] ) ->getMock(); @@ -434,7 +434,7 @@ class OutputPageTest extends MediaWikiTestCase { */ public function testVaryHeaders( $calls, $vary, $key ) { // get rid of default Vary fields - $outputPage = $this->getMockBuilder( 'OutputPage' ) + $outputPage = $this->getMockBuilder( OutputPage::class ) ->setConstructorArgs( [ new RequestContext() ] ) ->setMethods( [ 'getCacheVaryCookies' ] ) ->getMock(); @@ -525,7 +525,7 @@ class OutputPageTest extends MediaWikiTestCase { $this->assertTrue( $outputPage->haveCacheVaryCookies() ); } - /* + /** * @covers OutputPage::addCategoryLinks * @covers OutputPage::getCategories */ @@ -539,7 +539,7 @@ class OutputPageTest extends MediaWikiTestCase { 'page_title' => 'Test2' ] ] ); - $outputPage = $this->getMockBuilder( 'OutputPage' ) + $outputPage = $this->getMockBuilder( OutputPage::class ) ->setConstructorArgs( [ new RequestContext() ] ) ->setMethods( [ 'addCategoryLinksToLBAndGetResult' ] ) ->getMock(); @@ -640,6 +640,17 @@ class OutputPageTest extends MediaWikiTestCase { 'not all and (min-resolution: 2dppx),' . ';rel=preload;as=image;media=(min-resolution: 2dppx)' ], + [ + [ + 'ResourceBasePath' => '/w', + 'Logo' => '/img/default.png', + 'LogoHD' => [ + 'svg' => '/img/vector.svg', + ], + ], + 'Link: ;rel=preload;as=image' + + ], [ [ 'ResourceBasePath' => '/w',