'test'])); } // Auxiliary Methods /** * Defines the HTTP method that will be used in the requests made by the tests. * * @return string The HTTP method to be used for the request * (e.g., 'GET', 'POST', 'PUT', 'DELETE'). */ abstract protected function getMethod(): string; protected function getUri(?int $id = null): string { $param = $id == null ? '' : "/$id"; return self::BASE_URI.$param; } protected function createTestProjectOptimized(int $count = 1, array $attributes = []): array { $owner = TestUser::get(); $territory = new Territory('ES'); $mergedAttributes = array_merge([ 'owner' => $owner, 'territory' => $territory, ], $attributes); return ProjectFactory::createMany($count, $mergedAttributes); } // Auxiliary Tests protected function testOneNotFound(): void { $this->createTestProjectOptimized(1); $this->request($this->getMethod(), $this->getUri(999), [], Response::HTTP_NOT_FOUND); } }