infinito/application/symfony/tests/Unit/Controller/DefaultControllerTest.php

44 lines
1.1 KiB
PHP

<?php
namespace Infinito\Tests\Unit\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Infinito\Controller\DefaultController;
use Infinito\DBAL\Types\RESTResponseType;
/**
* @author kevinfrantz
*/
class DefaultControllerTest extends WebTestCase
{
/**
* @var DefaultController
*/
protected $defaultController;
public function setUp(): void
{
$this->defaultController = new DefaultController();
}
public function testHomepage(): void
{
$client = static::createClient();
$client->request('GET', '/');
$this->assertEquals(200, $client->getResponse()
->getStatusCode());
}
public function testImprint(): void
{
$client = static::createClient();
foreach (RESTResponseType::getValues() as $format) {
$format = 'html';
$url = '/api/rest/source/imprint.'.$format;
$client->request('GET', $url);
$this->assertEquals(200, $client->getResponse()
->getStatusCode(), "Route $url is not reachable.");
}
}
}