fix tests
This commit is contained in:
parent
332b8cf7ef
commit
14fd06a11f
|
|
@ -6,6 +6,7 @@ use App\Models\Texture;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
|
use Laravel\Passport\Passport;
|
||||||
|
|
||||||
class ClosetManagementControllerTest extends TestCase
|
class ClosetManagementControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
@ -23,8 +24,8 @@ class ClosetManagementControllerTest extends TestCase
|
||||||
$admin = User::factory()->admin()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
$admin->closet()->attach($texture->tid);
|
$admin->closet()->attach($texture->tid);
|
||||||
|
|
||||||
$this->actingAs($admin, 'oauth')
|
Passport::actingAs($admin, ['ClosetManagement.Read'], 'oauth');
|
||||||
->getJson('/api/admin/closet/'.$admin->uid)
|
$this->getJson('/api/admin/closet/'.$admin->uid)
|
||||||
->assertJson([['tid' => $texture->tid]]);
|
->assertJson([['tid' => $texture->tid]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ namespace Tests;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Notifications;
|
use App\Notifications;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Laravel\Passport\Passport;
|
||||||
use League\CommonMark\GithubFlavoredMarkdownConverter;
|
use League\CommonMark\GithubFlavoredMarkdownConverter;
|
||||||
|
|
||||||
class NotificationsControllerTest extends TestCase
|
class NotificationsControllerTest extends TestCase
|
||||||
|
|
@ -100,8 +101,8 @@ class NotificationsControllerTest extends TestCase
|
||||||
|
|
||||||
$id = $user->unreadNotifications->first()->id;
|
$id = $user->unreadNotifications->first()->id;
|
||||||
|
|
||||||
$this->actingAs($user, 'oauth')
|
Passport::actingAs($user, ['Notification.Read'], 'oauth');
|
||||||
->getJson('/api/user/notifications')
|
$this->getJson('/api/user/notifications')
|
||||||
->assertJson([['id' => $id, 'title' => 'title']]);
|
->assertJson([['id' => $id, 'title' => 'title']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user