From 90ba76c237ca9a91e30b3333129ccfb590443cc0 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 27 Aug 2020 21:22:05 -0700 Subject: [PATCH] Return integration tests to passing state --- .../Server/Schedule/CreateServerScheduleTest.php | 5 +++-- .../ScheduleTask/CreateServerScheduleTaskTest.php | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php b/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php index 78f6253ed..51345fa79 100644 --- a/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php +++ b/tests/Integration/Api/Client/Server/Schedule/CreateServerScheduleTest.php @@ -57,8 +57,9 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase $response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY); foreach (['name', 'minute', 'hour', 'day_of_month', 'day_of_week'] as $i => $field) { - $response->assertJsonPath("errors.{$i}.code", 'required'); - $response->assertJsonPath("errors.{$i}.source.field", $field); + $response->assertJsonPath("errors.{$i}.code", 'ValidationException'); + $response->assertJsonPath("errors.{$i}.meta.rule", 'required'); + $response->assertJsonPath("errors.{$i}.meta.source_field", $field); } $this->actingAs($user) diff --git a/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php b/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php index 8dba137b5..9f263acd7 100644 --- a/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php +++ b/tests/Integration/Api/Client/Server/ScheduleTask/CreateServerScheduleTaskTest.php @@ -56,8 +56,8 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase $response = $this->actingAs($user)->postJson($this->link($schedule, '/tasks'))->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY); foreach (['action', 'payload', 'time_offset'] as $i => $field) { - $response->assertJsonPath("errors.{$i}.code", $field === 'payload' ? 'required_unless' : 'required'); - $response->assertJsonPath("errors.{$i}.source.field", $field); + $response->assertJsonPath("errors.{$i}.meta.rule", $field === 'payload' ? 'required_unless' : 'required'); + $response->assertJsonPath("errors.{$i}.meta.source_field", $field); } $this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [ @@ -67,7 +67,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase ]) ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonPath('errors.0.meta.rule', 'in') - ->assertJsonPath('errors.0.source.field', 'action'); + ->assertJsonPath('errors.0.meta.source_field', 'action'); $this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [ 'action' => 'command', @@ -75,7 +75,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase ]) ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonPath('errors.0.meta.rule', 'required_unless') - ->assertJsonPath('errors.0.source.field', 'payload'); + ->assertJsonPath('errors.0.meta.source_field', 'payload'); $this->actingAs($user)->postJson($this->link($schedule, '/tasks'), [ 'action' => 'command', @@ -85,7 +85,7 @@ class CreateServerScheduleTaskTest extends ClientApiIntegrationTestCase ]) ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY) ->assertJsonPath('errors.0.meta.rule', 'numeric') - ->assertJsonPath('errors.0.source.field', 'sequence_id'); + ->assertJsonPath('errors.0.meta.source_field', 'sequence_id'); } /**