Follow-up 3270283abf.
This way the test is only run on commits made to this repo, not on all
skins and extensions, and so saving an awful lot of downloads from
happening in CI unnecessarily.
Bug: T203694
Change-Id: I071be5821711fb8b039ff24293f66a8ff9d70514
36 lines
975 B
PHP
36 lines
975 B
PHP
<?php
|
|
|
|
/**
|
|
* @group Standalone
|
|
* @coversNothing
|
|
*/
|
|
class ForeignResourceStructureTest extends \PHPUnit\Framework\TestCase {
|
|
|
|
public function testVerifyIntegrity() {
|
|
global $IP;
|
|
$out = '';
|
|
$frm = new ForeignResourceManager(
|
|
"{$IP}/resources/lib/foreign-resources.yaml",
|
|
"{$IP}/resources/lib",
|
|
static function ( $text ) use ( &$out ) {
|
|
$out .= $text;
|
|
}
|
|
);
|
|
|
|
// The "verify" action verifies two things:
|
|
// 1. Mismatching SRI hashes.
|
|
// These throw an exception with the actual/expect values
|
|
// to place in foreign-resources.yaml.
|
|
// 2. Mismatching file contents.
|
|
// These print messages about each mismatching file,
|
|
// and then we add our help text afterward for how to
|
|
// automatically update the file resources.
|
|
|
|
$helpUpdate = '
|
|
To update a foreign resource, run:
|
|
$ php maintenance/manageForeignResources.php update <moduleName>
|
|
';
|
|
|
|
$this->assertTrue( $frm->run( 'verify', 'all' ), "$out\n$helpUpdate" );
|
|
}
|
|
}
|