Tests/Controller/DefaultControllerTest.php
author cavaliet
Thu, 20 Oct 2011 18:35:33 +0200
changeset 8 7d2fb5d7c9ff
parent 1 06a22ff5d58d
permissions -rwxr-xr-x
debug addtag for document
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace IRI\Bundle\WikiTagBundle\Tests\Controller;
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
class DefaultControllerTest extends WebTestCase
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
{
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
    public function testIndex()
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    {
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
        $client = static::createClient();
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
        $crawler = $client->request('GET', '/hello/Fabien');
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    }
06a22ff5d58d first commit forminimal bundle structure
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
}