/**
* @dataProvider provideAllowedData
*/
public function testAllowedCombinations(ContextSource
$source, bool
$authRequired): void
{ $scope =
$this->
getContainer()->
get(ApiRouteScope::
class);
$request = Request::
create('/api/foo'
);
$request->attributes->
set(PlatformRequest::ATTRIBUTE_CONTEXT_OBJECT, Context::
createDefaultContext($source));
$request->attributes->
set('auth_required',
$authRequired);
static::
assertTrue($scope->
isAllowedPath($request->
getPathInfo()));
static::
assertTrue($scope->
isAllowed($request));
} /**
* @dataProvider provideForbiddenData
*/
public function testForbiddenCombinations(ContextSource
$source, bool
$authRequired): void
{ $scope =
$this->
getContainer()->
get(ApiRouteScope::
class);
$request = Request::
create('/api/foo'
);