src/Company/BaseBundle/Tests/Controller/DefaultControllerTest.php
author cavaliet
Wed, 26 Oct 2011 16:01:33 +0200
changeset 17 a16b5806e3f0
parent 2 806e57d67020
permissions -rwxr-xr-x
Little modification to enable routing from tag list.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace Company\BaseBundle\Tests\Controller;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
class DefaultControllerTest extends WebTestCase
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
{
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
    public function testIndex()
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    {
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
        $client = static::createClient();
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
        $crawler = $client->request('GET', '/hello/Fabien');
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    }
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
}