Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/tests/phpunit/includes/OutputTransform/Stages/RenderDebugInfoTest.php
Ðазад
<?php namespace MediaWiki\Tests\OutputTransform\Stages; use MediaWiki\Config\ServiceOptions; use MediaWiki\OutputTransform\OutputTransformStage; use MediaWiki\OutputTransform\Stages\RenderDebugInfo; use MediaWiki\Parser\ParserOutput; use MediaWiki\Tests\OutputTransform\OutputTransformStageTestBase; use Psr\Log\NullLogger; /** * @covers \MediaWiki\OutputTransform\Stages\RenderDebugInfo */ class RenderDebugInfoTest extends OutputTransformStageTestBase { public function createStage(): OutputTransformStage { return new RenderDebugInfo( new ServiceOptions( [] ), new NullLogger(), $this->getServiceContainer()->getHookContainer() ); } public function provideShouldRun(): array { return [ [ new ParserOutput(), null, [ 'includeDebugInfo' => true ] ], ]; } public function provideShouldNotRun(): array { return [ [ new ParserOutput(), null, [] ], [ new ParserOutput(), null, [ 'includeDebugInfo' => false ] ], ]; } /** * TODO this only covers the addition of the report, not the content of the report itself. Expanding this * test may be a good idea. */ public function provideTransform(): array { $text = <<<EOF <!DOCTYPE html> <html><head><title>Main Page</title></head><body data-parsoid='{"dsr":[0,6,0,0]}' lang="en"><p data-parsoid='{"dsr":[0,5,0,0]}'>hello</p> </body></html> EOF; $expectedText = $text . "\n<!-- \nNewPP limit report\nComplications: []\n-->\n"; $po = new ParserOutput( $text ); $po->setLimitReportData( 'test', 'limit' ); $expected = new ParserOutput( $expectedText ); $expected->setLimitReportData( 'test', 'limit' ); return [ [ $po, null, [], $expected ], ]; } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка