mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Ensure that a min/max arg count is available for all built-in functions
This is especially useful for old patches, created before the introduction of FUNC_ARG_COUNT, where a rebase may break the parser. Change-Id: Ib142438626a7305f102dc3e4cc9cb07ad33902b8
This commit is contained in:
parent
a8c50150d6
commit
0672a8eb8a
|
@ -1172,4 +1172,16 @@ class AbuseFilterParserTest extends AbuseFilterParserTestCase {
|
|||
[ 'timestamp / 0.0', 'dividebyzero' ],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that every function in AbuseFilterParser::FUNCTIONS is also listed in
|
||||
* AbuseFilterParser::FUNC_ARG_COUNT
|
||||
*/
|
||||
public function testAllFunctionsHaveArgCount() {
|
||||
$funcs = array_keys( AbuseFilterParser::FUNCTIONS );
|
||||
sort( $funcs );
|
||||
$argsCount = array_keys( AbuseFilterParser::FUNC_ARG_COUNT );
|
||||
sort( $argsCount );
|
||||
$this->assertSame( $funcs, $argsCount );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue