$strategy =
new HttpCodeActivationStrategy( $requestStack,
[ ['code' => 403, 'urls' =>
[]],
['code' => 404, 'urls' =>
[]],
['code' => 405, 'urls' =>
[]],
['code' => 400, 'urls' =>
['^/400/a', '^/400/b'
]],
],
new ErrorLevelActivationStrategy(Logger::WARNING
) );
self::
assertEquals($expected,
$strategy->
isHandlerActivated($record));
} public static function isActivatedProvider(): array
{ return [ ['/test', RecordFactory::
create(Logger::ERROR
), true
],
['/400', RecordFactory::
create(Logger::ERROR, context: self::
getContextException(400
)), true
],
['/400/a', RecordFactory::
create(Logger::ERROR, context: self::
getContextException(400
)), false
],
['/400/b', RecordFactory::
create(Logger::ERROR, context: self::
getContextException(400
)), false
],
['/400/c', RecordFactory::
create(Logger::ERROR, context: self::
getContextException(400
)), true
],
['/401', RecordFactory::
create(Logger::ERROR, context: self::
getContextException(401
)), true
],
[