Added tasks endpoints; Added more test

This commit is contained in:
Constantin Graf
2024-03-21 21:26:42 +01:00
parent 33eff16b6b
commit 4edfa7e941
33 changed files with 810 additions and 52 deletions

View File

@@ -23,7 +23,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
$response = $this->getJson(route('api.v1.clients.index', [$data->organization->getKey()]));
// Assert
$response->assertStatus(403);
$response->assertForbidden();
}
public function test_index_endpoint_returns_list_of_all_clients_of_organization_ordered_by_created_at_desc_per_default(): void
@@ -66,7 +66,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
]);
// Assert
$response->assertStatus(403);
$response->assertForbidden();
}
public function test_store_endpoint_creates_new_client(): void
@@ -106,7 +106,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
]);
// Assert
$response->assertStatus(403);
$response->assertForbidden();
}
public function test_update_endpoint_fails_if_user_is_not_part_of_client_organization(): void
@@ -126,7 +126,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
]);
// Assert
$response->assertStatus(403);
$response->assertForbidden();
$this->assertDatabaseHas(Client::class, [
'id' => $client->getKey(),
'name' => $client->name,
@@ -173,7 +173,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
$response = $this->deleteJson(route('api.v1.clients.destroy', [$data->organization->getKey(), $client->getKey()]));
// Assert
$response->assertStatus(403);
$response->assertForbidden();
}
public function test_destroy_endpoint_fails_if_user_is_not_part_of_client_organization(): void
@@ -190,7 +190,7 @@ class ClientEndpointTest extends ApiEndpointTestAbstract
$response = $this->deleteJson(route('api.v1.clients.destroy', [$data->organization->getKey(), $client->getKey()]));
// Assert
$response->assertStatus(403);
$response->assertForbidden();
$this->assertDatabaseHas(Client::class, [
'id' => $client->getKey(),
'name' => $client->name,