Merge "Add structure test to verify contents of pygments.generated.css"

This commit is contained in:
jenkins-bot 2024-09-28 17:17:19 +00:00 committed by Gerrit Code Review
commit f4f8f00210

View file

@ -2,6 +2,7 @@
use MediaWiki\MainConfigNames;
use MediaWiki\Shell\CommandFactory;
use MediaWiki\SyntaxHighlight\Pygmentize;
use MediaWiki\SyntaxHighlight\SyntaxHighlight;
use Shellbox\Command\BoxedCommand;
use Shellbox\Command\BoxedResult;
@ -75,4 +76,13 @@ class PygmentizeTest extends MediaWikiIntegrationTestCase {
$status = SyntaxHighlight::highlight( '"example"', 'json' );
$this->assertSame( $expect, $status->getValue() );
}
public function testFetchGeneratedCss() {
// Check that pygments.generated.css was generated by running the maintenance script
$file = __DIR__ . '/../../modules/pygments.generated.css';
$fileContent = file_get_contents( $file );
$generatedCss = "/* Stylesheet generated by updateCSS.php */\n" . Pygmentize::fetchGeneratedCSS();
$this->assertEquals( $generatedCss, $fileContent );
}
}