Implemented tests to check if standard routes are reachable

This commit is contained in:
Kevin Frantz 2018-09-05 18:05:59 +02:00
parent 2f1099b719
commit d71895b0e8

View File

@ -2,13 +2,14 @@
namespace App\Controller; namespace App\Controller;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/** /**
* *
* @author kevinfrantz * @author kevinfrantz
* *
*/ */
class DefaultControllerTest extends TestCase class DefaultControllerTest extends WebTestCase
{ {
/** /**
* @var DefaultControllerInterface * @var DefaultControllerInterface
@ -20,11 +21,15 @@ class DefaultControllerTest extends TestCase
} }
public function testHomepage():void{ 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{ public function testImprint():void{
$this->assertEquals(true, $this->defaultController->imprint()->isSuccessful()); $client = static::createClient();
$client->request('GET', '/imprint');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
} }
} }