|
@@ 84-93 (lines=10) @@
|
| 81 |
|
}); |
| 82 |
|
|
| 83 |
|
// with the wrong roles, checkPermissions method SHOULD throw an exception |
| 84 |
|
$this->assertExceptionRaised(NotFoundHttpException::class, function () use ($admin) { |
| 85 |
|
$request = new Request([], [], [ |
| 86 |
|
'_route_params' => [ |
| 87 |
|
'_action' => 'custom_list' |
| 88 |
|
] |
| 89 |
|
]); |
| 90 |
|
$user = new User('JohnKrovitch', 'john1234'); |
| 91 |
|
$admin->handleRequest($request); |
| 92 |
|
$admin->checkPermissions($user); |
| 93 |
|
}); |
| 94 |
|
|
| 95 |
|
// with the wrong roles, checkPermissions method SHOULD throw an exception |
| 96 |
|
$this->assertExceptionRaised(NotFoundHttpException::class, function () use ($admin) { |
|
@@ 96-107 (lines=12) @@
|
| 93 |
|
}); |
| 94 |
|
|
| 95 |
|
// with the wrong roles, checkPermissions method SHOULD throw an exception |
| 96 |
|
$this->assertExceptionRaised(NotFoundHttpException::class, function () use ($admin) { |
| 97 |
|
$request = new Request([], [], [ |
| 98 |
|
'_route_params' => [ |
| 99 |
|
'_action' => 'custom_list' |
| 100 |
|
] |
| 101 |
|
]); |
| 102 |
|
$user = new User('JohnKrovitch', 'john1234', [ |
| 103 |
|
'ROLE_USER' |
| 104 |
|
]); |
| 105 |
|
$admin->handleRequest($request); |
| 106 |
|
$admin->checkPermissions($user); |
| 107 |
|
}); |
| 108 |
|
|
| 109 |
|
// with the right role, checkPermissions method SHOULD NOT throw an exception |
| 110 |
|
$request = new Request([], [], [ |