@@ 14-29 (lines=16) @@ | ||
11 | ||
12 | namespace Tests\Controller; |
|
13 | ||
14 | class DefaultControllerComponentTest extends \ComponentWebTestCase |
|
15 | { |
|
16 | public function testIndex() |
|
17 | { |
|
18 | $client = static::createClient(); |
|
19 | ||
20 | $crawler = $client->request('GET', '/'); |
|
21 | ||
22 | $this->assertSame( |
|
23 | 200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK, |
|
24 | $client->getResponse()->getStatusCode() |
|
25 | ); |
|
26 | ||
27 | $this->assertContains('Hello World!', $client->getResponse()->getContent()); |
|
28 | } |
|
29 | } |
|
30 |
@@ 16-31 (lines=16) @@ | ||
13 | ||
14 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
|
15 | ||
16 | class DefaultControllerTest extends WebTestCase |
|
17 | { |
|
18 | public function testIndex() |
|
19 | { |
|
20 | $client = static::createClient(); |
|
21 | ||
22 | $crawler = $client->request('GET', '/'); |
|
23 | ||
24 | $this->assertSame( |
|
25 | 200, // or Symfony\Component\HttpFoundation\Response::HTTP_OK, |
|
26 | $client->getResponse()->getStatusCode() |
|
27 | ); |
|
28 | ||
29 | $this->assertContains('Hello World!', $client->getResponse()->getContent()); |
|
30 | } |
|
31 | } |
|
32 |