apiRoutesContainingAny(['students', 'users', 'attendance', 'scores', 'finance', 'inventory', 'settings', 'profile']); foreach (array_slice($routes, 0, 45) as $route) { $method = $this->primaryMethod($route); if (! in_array($method, ['POST', 'PUT', 'PATCH'], true)) { continue; } $uri = $route->uri(); $response = $this->withHeaders([ 'If-Match' => '"stale-batch16-etag"', 'If-Unmodified-Since' => 'Mon, 01 Jan 1990 00:00:00 GMT', ])->requestAs($this->actorFor($uri), $method, $uri, $this->payloadFor($method, $uri) + [ 'version' => -1, 'lock_version' => -999, 'updated_at' => '1990-01-01T00:00:00Z', 'force_overwrite' => true, 'ignore_conflicts' => true, ]); $this->assertControlled($response, $method, $uri); $this->assertStringNotContainsString('optimisticlockexception', strtolower($response->getContent())); } } }