Skip to content

Commit

Permalink
Add /admin route to test authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
alexislefebvre committed May 13, 2022
1 parent a63655f commit 497ed50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/App/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ security:
entity: { class: Liip\Acme\Tests\App\Entity\User, property: id }
firewalls:
secured_area:
pattern: ^/
pattern: ^/admin
anonymous: lazy
http_basic:
realm: "Admin Area"
provider: chain_provider
access_control:
- { path: ^/admin, roles: IS_AUTHENTICATED_FULLY }
- { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }

services:
Expand Down
4 changes: 4 additions & 0 deletions tests/App/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ liipfunctionaltestbundle_homepage:
path: /
defaults: { _controller: 'Liip\Acme\Tests\App\Controller\DefaultController::indexAction' }

liipfunctionaltestbundle_admin:
path: /admin
defaults: { _controller: 'Liip\Acme\Tests\App\Controller\DefaultController::indexAction' }

liipfunctionaltestbundle_user:
path: /user/{userId}
defaults: { _controller: 'Liip\Acme\Tests\App\Controller\DefaultController::userAction' }
Expand Down

0 comments on commit 497ed50

Please sign in to comment.