Initial commit with basic structure
This commit is contained in:
26
tests/controllersTest.php
Normal file
26
tests/controllersTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Silex\WebTestCase;
|
||||
|
||||
class controllersTest extends WebTestCase
|
||||
{
|
||||
public function testGetHomepage()
|
||||
{
|
||||
$client = $this->createClient();
|
||||
$client->followRedirects(true);
|
||||
$crawler = $client->request('GET', '/');
|
||||
|
||||
$this->assertTrue($client->getResponse()->isOk());
|
||||
$this->assertContains('Welcome', $crawler->filter('body')->text());
|
||||
}
|
||||
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../src/app.php';
|
||||
require __DIR__.'/../config/dev.php';
|
||||
require __DIR__.'/../src/controllers.php';
|
||||
$app['session.test'] = true;
|
||||
|
||||
return $this->app = $app;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user