|
@@ -2,25 +2,27 @@
|
|
|
|
|
|
use Silex\WebTestCase;
|
|
use Silex\WebTestCase;
|
|
|
|
|
|
-class controllersTest extends WebTestCase
|
|
|
|
-{
|
|
|
|
- public function testGetHomepage()
|
|
|
|
- {
|
|
|
|
- $client = $this->createClient();
|
|
|
|
- $client->followRedirects(true);
|
|
|
|
- $crawler = $client->request('GET', '/');
|
|
|
|
|
|
+class controllersTest extends WebTestCase {
|
|
|
|
|
|
- $this->assertTrue($client->getResponse()->isOk());
|
|
|
|
- $this->assertContains('Welcome', $crawler->filter('body')->text());
|
|
|
|
- }
|
|
|
|
|
|
+ public function testGetHomepage() {
|
|
|
|
+ $client = $this->createClient();
|
|
|
|
+ $client->followRedirects(TRUE);
|
|
|
|
+ $crawler = $client->request('GET', '/');
|
|
|
|
|
|
- public function createApplication()
|
|
|
|
- {
|
|
|
|
- $app = require __DIR__.'/../src/app.php';
|
|
|
|
- require __DIR__.'/../config/dev.php';
|
|
|
|
- require __DIR__.'/../src/controllers.php';
|
|
|
|
- $app['session.test'] = true;
|
|
|
|
|
|
+ $this->assertTrue($client->getResponse()->isOk());
|
|
|
|
+ // cf index.html.twig.
|
|
|
|
+ $this->assertContains('Welcome', $crawler->filter('body')->text());
|
|
|
|
+ }
|
|
|
|
|
|
- return $this->app = $app;
|
|
|
|
- }
|
|
|
|
|
|
+ public function createApplication() {
|
|
|
|
+ $app = require __DIR__ . '/../src/app.php';
|
|
|
|
+ require __DIR__ . '/../config/dev.php';
|
|
|
|
+ require __DIR__ . '/../src/controllers.php';
|
|
|
|
+ $app['session.test'] = TRUE;
|
|
|
|
+
|
|
|
|
+ // Get raw exceptions instead of HTML page responses.
|
|
|
|
+ // unset($app['exception_handler']);
|
|
|
|
+
|
|
|
|
+ return $this->app = $app;
|
|
|
|
+ }
|
|
}
|
|
}
|