Tests/Controller/DefaultControllerTest.php
author ymh <ymh.work@gmail.com>
Wed, 05 Oct 2011 23:51:31 +0200
changeset 1 06a22ff5d58d
permissions -rw-r--r--
first commit forminimal bundle structure
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
}