fix tests
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Tests\Feature\Api\V1\Settings;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Services\Settings\SchoolCalendar\SchoolCalendarMutationService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
@@ -50,7 +51,7 @@ class SchoolCalendarControllerTest extends TestCase
|
||||
$eventId = $this->seedEvent();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
$response = $this->getJson('/api/v1/settings/school-calendar/events/' . $eventId);
|
||||
$response = $this->getJson('/api/v1/settings/school-calendar/events/'.$eventId);
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('status', true);
|
||||
@@ -88,7 +89,7 @@ class SchoolCalendarControllerTest extends TestCase
|
||||
$eventId = $this->seedEvent();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
$response = $this->patchJson('/api/v1/settings/school-calendar/events/' . $eventId, [
|
||||
$response = $this->patchJson('/api/v1/settings/school-calendar/events/'.$eventId, [
|
||||
'title' => 'Updated Event',
|
||||
]);
|
||||
|
||||
@@ -107,7 +108,7 @@ class SchoolCalendarControllerTest extends TestCase
|
||||
$eventId = $this->seedEvent();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
$response = $this->deleteJson('/api/v1/settings/school-calendar/events/' . $eventId);
|
||||
$response = $this->deleteJson('/api/v1/settings/school-calendar/events/'.$eventId);
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertJsonPath('status', true);
|
||||
@@ -134,8 +135,9 @@ class SchoolCalendarControllerTest extends TestCase
|
||||
$user = $this->seedUser();
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->app->bind(\App\Services\Settings\SchoolCalendar\SchoolCalendarMutationService::class, function () {
|
||||
return new class {
|
||||
$this->app->bind(SchoolCalendarMutationService::class, function () {
|
||||
return new class
|
||||
{
|
||||
public function create(array $payload, array $targets = []): array
|
||||
{
|
||||
throw new \RuntimeException('fail');
|
||||
|
||||
Reference in New Issue
Block a user