fix tests
This commit is contained in:
parent
332b8cf7ef
commit
14fd06a11f
|
|
@ -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]]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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']]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user