mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SecureLinkFixer
synced 2024-11-24 15:43:39 +00:00
Merge "Add a test verifying the reproducibility of domains.php"
This commit is contained in:
commit
728a5b0825
|
@ -18,6 +18,7 @@
|
|||
|
||||
namespace MediaWiki\SecureLinkFixer\Test;
|
||||
|
||||
use MediaWiki\SecureLinkFixer\ListFetcher;
|
||||
use MediaWikiTestCase;
|
||||
|
||||
/**
|
||||
|
@ -26,6 +27,16 @@ use MediaWikiTestCase;
|
|||
*/
|
||||
class DomainsTest extends MediaWikiTestCase {
|
||||
|
||||
public function testReproducibility() {
|
||||
$domains = file_get_contents( __DIR__ . '/../../domains.php' );
|
||||
preg_match( '/mozilla-central@([0-9a-f]*?) \((.*?)\)/', $domains, $matches );
|
||||
$this->assertCount( 3, $matches );
|
||||
[ , $rev, $date ] = $matches;
|
||||
$lf = new ListFetcher();
|
||||
$expected = $lf->fetchList( $rev, $date );
|
||||
$this->assertSame( $expected, $domains );
|
||||
}
|
||||
|
||||
public function testDomains() {
|
||||
$domains = require __DIR__ . '/../../domains.php';
|
||||
$this->assertIsArray( $domains );
|
||||
|
|
Loading…
Reference in a new issue