DefaultControllerTest.php 460 B

123456789101112131415161718
  1. <?php
  2. namespace Tests\AppBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
  4. class DefaultControllerTest extends WebTestCase
  5. {
  6. public function testIndex()
  7. {
  8. $client = static::createClient();
  9. $crawler = $client->request('GET', '/');
  10. $this->assertEquals(200, $client->getResponse()->getStatusCode());
  11. $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text());
  12. }
  13. }