Fix SpecialPage alias test

This was testing regex with completely unecessary long string.

I believe it was meant to be the test message instead of being the
haystack. Only the value of $alias may contain the slash, the rest
of the string has no any other slash, this is already known.

Also use simple string assertion instead of regex matching

Change-Id: I47eb0bfcd510e4f1c92099a9cb53b584a34036ce
This commit is contained in:
Ammarpad 2021-01-14 07:59:50 +01:00
parent e2894e92ea
commit c2743edd26

View file

@ -20,8 +20,8 @@ class SpecialPageAliasTest extends MediaWikiIntegrationTestCase {
public function testValidSpecialPageAliases( $code, $specialPageAliases ) {
foreach ( $specialPageAliases as $specialPage => $aliases ) {
foreach ( $aliases as $alias ) {
$msg = "$specialPage alias '$alias' in $code is valid with no slashes";
$this->assertRegExp( '/^[^\/]*$/', $msg );
$msg = "Special:$specialPage alias '$alias' in $code must not contain slashes";
$this->assertStringNotContainsString( '/', $alias, $msg );
}
}
}