From d71895b0e87a164b6fe821e82b27439f214a9bd2 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Wed, 5 Sep 2018 18:05:59 +0200 Subject: [PATCH] Implemented tests to check if standard routes are reachable --- application/src/Controller/DefaultControllerTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/application/src/Controller/DefaultControllerTest.php b/application/src/Controller/DefaultControllerTest.php index bcf13b5..43705d4 100644 --- a/application/src/Controller/DefaultControllerTest.php +++ b/application/src/Controller/DefaultControllerTest.php @@ -2,13 +2,14 @@ namespace App\Controller; use PHPUnit\Framework\TestCase; +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; /** * * @author kevinfrantz * */ -class DefaultControllerTest extends TestCase +class DefaultControllerTest extends WebTestCase { /** * @var DefaultControllerInterface @@ -20,11 +21,15 @@ class DefaultControllerTest extends TestCase } public function testHomepage():void{ - $this->assertEquals(true, $this->defaultController->homepage()->isSuccessful()); + $client = static::createClient(); + $client->request('GET', '/'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); } public function testImprint():void{ - $this->assertEquals(true, $this->defaultController->imprint()->isSuccessful()); + $client = static::createClient(); + $client->request('GET', '/imprint'); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); } }