Skip to content

Commit

Permalink
[framework] admin can manage customer user group roles (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
malyMiso committed Aug 21, 2024
2 parents 4273e34 + f9fa9da commit 5944543
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/tests/App/Smoke/Http/RouteConfigCustomization.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,16 @@ private function configureAdminRoutes(RouteConfigCustomizer $routeConfigCustomiz
if (preg_match('~^admin_(superadmin_|translation_list$)~', $info->getRouteName())) {
$config->changeDefaultRequestDataSet('Only superadmin should be able to see this route.')
->setExpectedStatusCode(403);
$config->addExtraRequestDataSet('Should be OK when logged in as "superadmin".')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(200);

if (preg_match('~(_delete$)~', $info->getRouteName())) {
$config->changeDefaultRequestDataSet('Expect redirect by 302 for any delete action.')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(302);
} else {
$config->addExtraRequestDataSet('Should be OK when logged in as "superadmin".')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(200);
}
}
})
->customizeByRouteName('admin_login', function (RouteConfig $config) {
Expand Down

0 comments on commit 5944543

Please sign in to comment.