add test batches
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\V1\FullSurface;
|
||||
|
||||
use Tests\Feature\Api\V1\FullSurface\Support\FullSurfaceE2EContractCase;
|
||||
|
||||
class ApiRelationshipCardinalityContractTest extends FullSurfaceE2EContractCase
|
||||
{
|
||||
public function test_routes_expect_single_ids_do_not_crash_when_receiving_arrays_or_objects(): void
|
||||
{
|
||||
$routes = array_slice(array_filter($this->apiRoutes(), fn ($route) => in_array($this->primaryMethod($route), ['POST', 'PUT', 'PATCH'], true)), 0, 140);
|
||||
|
||||
foreach ($routes as $route) {
|
||||
$method = $this->primaryMethod($route);
|
||||
$uri = $route->uri();
|
||||
$payload = $this->payloadFor($method, $uri) + [
|
||||
'student_id' => [$this->ids['studentId'], 999999],
|
||||
'parent_id' => ['id' => $this->ids['parentId']],
|
||||
'teacher_id' => [$this->teacher->id],
|
||||
'class_section_id' => ['unexpected' => $this->ids['classSectionId']],
|
||||
'invoice_id' => [$this->ids['invoiceId']],
|
||||
];
|
||||
|
||||
$response = $this->requestAs($this->actorFor($uri), $method, $uri, $payload);
|
||||
|
||||
$this->assertControlled($response, $method, $uri);
|
||||
$this->assertNoServerError($response, 'relationship cardinality probe at ' . $method . ' ' . $uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user