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); } } }