diff --git a/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php b/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php index b440a125..23db3562 100644 --- a/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php +++ b/tests/HttpTest/ControllersTest/ClosetManagementControllerTest.php @@ -6,6 +6,7 @@ use App\Models\Texture; use App\Models\User; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Support\Facades\Event; +use Laravel\Passport\Passport; class ClosetManagementControllerTest extends TestCase { @@ -23,8 +24,8 @@ class ClosetManagementControllerTest extends TestCase $admin = User::factory()->admin()->create(); $admin->closet()->attach($texture->tid); - $this->actingAs($admin, 'oauth') - ->getJson('/api/admin/closet/'.$admin->uid) + Passport::actingAs($admin, ['ClosetManagement.Read'], 'oauth'); + $this->getJson('/api/admin/closet/'.$admin->uid) ->assertJson([['tid' => $texture->tid]]); } diff --git a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php index 61359552..a575e0fc 100644 --- a/tests/HttpTest/ControllersTest/NotificationsControllerTest.php +++ b/tests/HttpTest/ControllersTest/NotificationsControllerTest.php @@ -5,6 +5,7 @@ namespace Tests; use App\Models\User; use App\Notifications; use Illuminate\Support\Facades\Notification; +use Laravel\Passport\Passport; use League\CommonMark\GithubFlavoredMarkdownConverter; class NotificationsControllerTest extends TestCase @@ -100,8 +101,8 @@ class NotificationsControllerTest extends TestCase $id = $user->unreadNotifications->first()->id; - $this->actingAs($user, 'oauth') - ->getJson('/api/user/notifications') + Passport::actingAs($user, ['Notification.Read'], 'oauth'); + $this->getJson('/api/user/notifications') ->assertJson([['id' => $id, 'title' => 'title']]); }