Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -12,14 +12,13 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase
/**
* Test that a schedule can be created for the server.
*
* @param array $permissions
* @dataProvider permissionsDataProvider
*/
public function testScheduleCanBeCreatedForServer($permissions)
public function testScheduleCanBeCreatedForServer(array $permissions)
{
[$user, $server] = $this->generateTestAccount($permissions);
$response = $this->actingAs($user)->postJson("/api/client/servers/{$server->uuid}/schedules", [
$response = $this->actingAs($user)->postJson("/api/client/servers/$server->uuid/schedules", [
'name' => 'Test Schedule',
'is_active' => false,
'minute' => '0',
@ -55,17 +54,17 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase
{
[$user, $server] = $this->generateTestAccount();
$response = $this->actingAs($user)->postJson("/api/client/servers/{$server->uuid}/schedules", []);
$response = $this->actingAs($user)->postJson("/api/client/servers/$server->uuid/schedules", []);
$response->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY);
foreach (['name', 'minute', 'hour', 'day_of_month', 'day_of_week'] as $i => $field) {
$response->assertJsonPath("errors.{$i}.code", 'ValidationException');
$response->assertJsonPath("errors.{$i}.meta.rule", 'required');
$response->assertJsonPath("errors.{$i}.meta.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)
->postJson("/api/client/servers/{$server->uuid}/schedules", [
->postJson("/api/client/servers/$server->uuid/schedules", [
'name' => 'Testing',
'is_active' => 'no',
'minute' => '*',
@ -86,7 +85,7 @@ class CreateServerScheduleTest extends ClientApiIntegrationTestCase
[$user, $server] = $this->generateTestAccount([Permission::ACTION_SCHEDULE_UPDATE]);
$this->actingAs($user)
->postJson("/api/client/servers/{$server->uuid}/schedules", [])
->postJson("/api/client/servers/$server->uuid/schedules", [])
->assertForbidden();
}