diff --git a/includes/parser/AFPData.php b/includes/parser/AFPData.php index e234e0d6f..d15176593 100644 --- a/includes/parser/AFPData.php +++ b/includes/parser/AFPData.php @@ -119,12 +119,12 @@ class AFPData { return new AFPData( self::DINT, intval( $orig->data ) ); } elseif ( $target === self::DSTRING ) { return new AFPData( self::DSTRING, strval( $orig->data ) ); - // We don't expose any cast-to-array method... - // @codeCoverageIgnoreStart + // We don't expose any cast-to-array method... + // @codeCoverageIgnoreStart } elseif ( $target === self::DARRAY ) { return new AFPData( self::DARRAY, [ $orig ] ); - // @codeCoverageIgnoreEnd } + // @codeCoverageIgnoreEnd } /** @@ -450,7 +450,9 @@ class AFPData { case self::DNULL: return null; default: + // @codeCoverageIgnoreStart throw new MWException( "Unknown type" ); + // @codeCoverageIgnoreEnd } } diff --git a/tests/parserTests/regex.t b/tests/parserTests/regex.t index 706da02d3..4d2e6311e 100644 --- a/tests/parserTests/regex.t +++ b/tests/parserTests/regex.t @@ -1 +1,6 @@ -"foobér" rlike "^[fq]o{2}\\S.r$" & "foo" regex "^f..?.$" +"foobér" rlike "^[fq]o{2}\\S.r$" & +"foo" regex "^f..?.$" & +"UPPERCASE" irlike "uppercase" & +"lowercase" irlike "LOWERCASE" & +"1234567" irlike "12345" & +"FoObAR" irlike "^[a-z]+$" diff --git a/tests/phpunit/AbuseFilterConsequencesTest.php b/tests/phpunit/AbuseFilterConsequencesTest.php index 14b83a1e8..eb64a9cd4 100644 --- a/tests/phpunit/AbuseFilterConsequencesTest.php +++ b/tests/phpunit/AbuseFilterConsequencesTest.php @@ -36,6 +36,7 @@ use MediaWiki\Storage\NameTableAccessException; * @covers AbuseFilter * @covers AbuseFilterHooks * @covers AbuseFilterPreAuthenticationProvider + * @covers AbuseFilterParser::__construct * @todo Add upload actions everywhere */ class AbuseFilterConsequencesTest extends MediaWikiTestCase {