public function testGetScript() { $client = new TestClient(new TestHttpKernel()); $client->insulate(); $client->request('GET', '/'); $this->assertEquals('Request: /', $client->getResponse()->getContent(), '->getScript() returns a script that uses the request handler to make the request'); }
/** * {@inheritdoc} */ public function testDeletingTask() { $this->client->request(Request::METHOD_DELETE, '/tasks/1'); //Assert no error happened $this->assertEquals(Response::HTTP_NO_CONTENT, $this->client->getResponse()->getStatusCode()); //Assert the root element is correct and only has one item $task = $this->entityManager->getRepository(Task::class)->find(1); $this->assertNull($task); }
public function testGetScript() { if (!class_exists('Symfony\\Component\\Process\\Process')) { $this->markTestSkipped('The "Process" component is not available'); } if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader')) { $this->markTestSkipped('The "ClassLoader" component is not available'); } $client = new TestClient(new TestHttpKernel()); $client->insulate(); $client->request('GET', '/'); $this->assertEquals('Request: /', $client->getResponse()->getContent(), '->getScript() returns a script that uses the request handler to make the request'); }