mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Add structure test to verify contents of pygments.generated.css
Verify that running Pygmentize::fetchGeneratedCss() (which gets invoked from the updateCss.php maintenance script) gives CSS that matches the generated file pygments.generated.css. Change-Id: I454f287cb461b596178ee47c44634e2e127fe576
This commit is contained in:
parent
e259797d98
commit
c82db2de3e
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use MediaWiki\MainConfigNames;
|
use MediaWiki\MainConfigNames;
|
||||||
use MediaWiki\Shell\CommandFactory;
|
use MediaWiki\Shell\CommandFactory;
|
||||||
|
use MediaWiki\SyntaxHighlight\Pygmentize;
|
||||||
use MediaWiki\SyntaxHighlight\SyntaxHighlight;
|
use MediaWiki\SyntaxHighlight\SyntaxHighlight;
|
||||||
use Shellbox\Command\BoxedCommand;
|
use Shellbox\Command\BoxedCommand;
|
||||||
use Shellbox\Command\BoxedResult;
|
use Shellbox\Command\BoxedResult;
|
||||||
|
@ -75,4 +76,13 @@ class PygmentizeTest extends MediaWikiIntegrationTestCase {
|
||||||
$status = SyntaxHighlight::highlight( '"example"', 'json' );
|
$status = SyntaxHighlight::highlight( '"example"', 'json' );
|
||||||
$this->assertSame( $expect, $status->getValue() );
|
$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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue