public function testExistingIgnoreFile() { $filename =
$this->
createFile();
$ignorePatterns =
[ '/Test message .*/',
'/^\d* occurrences/',
];
file_put_contents($filename,
implode("\n",
$ignorePatterns));
$configuration = Configuration::
fromUrlEncodedString('ignoreFile='.
urlencode($filename));
$trace =
debug_backtrace();
$this->
assertTrue($configuration->
isIgnoredDeprecation(new Deprecation('Test message 1',
$trace, ''
)));
$this->
assertTrue($configuration->
isIgnoredDeprecation(new Deprecation('Test message 2',
$trace, ''
)));
$this->
assertFalse($configuration->
isIgnoredDeprecation(new Deprecation('Test mexxage 3',
$trace, ''
)));
$this->
assertTrue($configuration->
isIgnoredDeprecation(new Deprecation('1 occurrences',
$trace, ''
)));
$this->
assertTrue($configuration->
isIgnoredDeprecation(new Deprecation('1200 occurrences and more',
$trace, ''
)));
$this->
assertFalse($configuration->
isIgnoredDeprecation(new Deprecation('Many occurrences',
$trace, ''
)));
} public function testIgnoreFilePatternInvalid() { $filename =
$this->
createFile();
$ignorePatterns =
[