prepareTestProject(); $client = static::createClient(); $client->request('DELETE', $this->getUri(1), ['headers' => $this->getHeaders($client)]); $this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT); } public function testDeleteUnauthorized() { $this->prepareTestProject(); static::createClient()->request('DELETE', $this->getUri(1)); $this->assertResponseStatusCodeSame(Response::HTTP_INTERNAL_SERVER_ERROR); } public function testDeleteWithInvalidToken(): void { $this->testInvalidToken($this->getUri(1)); } public function testDeleteNotFound(): void { $this->testOneNotFound(); } public function testDeleteForbidden(): void { $otherUser = $this->createTestUser() ->setHandle('other_user')->setEmail('otheruser@example.com'); $otherProject = $this->createTestProject()->setOwner($otherUser); $this->entityManager->persist($otherProject); $this->prepareTestUser(); $client = static::createClient(); $client->request( $this->getMethod(), $this->getUri(1), ['headers' => $this->getHeaders($client)] ); $this->assertResponseStatusCodeSame(Response::HTTP_FORBIDDEN); } }