Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 7cd7b09

Browse files
committed
Fix test permission issue
1 parent 72ab101 commit 7cd7b09

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/src/Kernel/AuthCodeResourceTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Drupal\rest\Entity\RestResourceConfig;
1212
use Drupal\user\Entity\Role;
1313
use Drupal\user\Entity\User;
14-
use Stack\StackedHttpKernel;
14+
use Drupal\Core\StackMiddleware\StackedHttpKernel;
1515
use Symfony\Component\HttpFoundation\Request;
1616

1717
/**
@@ -70,10 +70,6 @@ protected function setUp(): void {
7070
$this->installConfig(['user']);
7171
$this->installConfig(['simple_oauth']);
7272

73-
$this->drupalSetUpCurrentUser();
74-
$this->setCurrentUser(User::getAnonymousUser());
75-
$this->grantPermissions(Role::load(Role::ANONYMOUS_ID), ['restful post simple_oauth_auth_code_auth_code']);
76-
7773
RestResourceConfig::create([
7874
'id' => 'simple_oauth_auth_code_auth_code',
7975
'plugin_id' => 'simple_oauth_auth_code_auth_code',
@@ -85,6 +81,10 @@ protected function setUp(): void {
8581
],
8682
])->save();
8783

84+
$this->drupalSetUpCurrentUser();
85+
$this->setCurrentUser(User::getAnonymousUser());
86+
$this->grantPermissions(Role::load(Role::ANONYMOUS_ID), ['restful post simple_oauth_auth_code_auth_code']);
87+
8888
$this->clientSecret = $this->randomString();
8989

9090
$this->client = Consumer::create([

0 commit comments

Comments
 (0)