File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
contexts/Authorization/Tests/Feature Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 1212use Contexts \Authorization \Infrastructure \Repositories \UserRepository ;
1313use Illuminate \Support \Facades \Config ;
1414
15- function setTestConfig ()
16- {
15+ beforeEach (function () {
1716 Config::set ('policies.article_publishing ' , [
1817 'context_default ' => [
1918 'handler ' => RolePolicy::class,
@@ -31,11 +30,9 @@ function setTestConfig()
3130 ],
3231 ],
3332 ]);
34- }
33+ });
3534
3635it ('can get default policy handler ' , function () {
37- setTestConfig ();
38-
3936 $ policy = app (PolicyFactory::class)
4037 ->forContext ('article_publishing ' )
4138 ->action ('publish ' );
@@ -44,8 +41,6 @@ function setTestConfig()
4441});
4542
4643it ('can evaluate user against policy ' , function () {
47- setTestConfig ();
48-
4944 $ userRepository = new UserRepository ;
5045
5146 $ userRecord = UserRecord::factory ()->create ();
You can’t perform that action at this time.
0 commit comments