controllersTest.php 665 B

1234567891011121314151617181920212223242526
  1. <?php
  2. use Silex\WebTestCase;
  3. class controllersTest extends WebTestCase
  4. {
  5. public function testGetHomepage()
  6. {
  7. $client = $this->createClient();
  8. $client->followRedirects(true);
  9. $crawler = $client->request('GET', '/');
  10. $this->assertTrue($client->getResponse()->isOk());
  11. $this->assertContains('Welcome', $crawler->filter('body')->text());
  12. }
  13. public function createApplication()
  14. {
  15. $app = require __DIR__.'/../src/app.php';
  16. require __DIR__.'/../config/dev.php';
  17. require __DIR__.'/../src/controllers.php';
  18. $app['session.test'] = true;
  19. return $this->app = $app;
  20. }
  21. }