Optimized Controller Draft

This commit is contained in:
Kevin Frantz
2019-01-05 21:26:36 +01:00
parent bc9c8f02a9
commit 609f156bfd
9 changed files with 93 additions and 97 deletions

View File

@@ -5,7 +5,10 @@ namespace Tests\Integration\Controller;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
class UrlIntegrationTest extends KernelTestCase
/**
* @author kevinfrantz
*/
class RoutesGetStatusIntegrationTest extends KernelTestCase
{
const GET_URLS_STATUS = [
'login' => 200,
@@ -13,6 +16,7 @@ class UrlIntegrationTest extends KernelTestCase
'register' => 301,
'logout' => 302,
'profile/edit' => 302,
'spa' => 200,
];
public function setUp(): void

View File

@@ -1,6 +1,6 @@
<?php
namespace Tests\Integration\Controller\API;
namespace Tests\Integration\Controller;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use App\DBAL\Types\LanguageType;
@@ -13,14 +13,14 @@ use Symfony\Component\HttpFoundation\Request;
*
* @todo Implement more tests for success etc.
*/
class ApiUrlReachableIntegrationTest extends KernelTestCase
class RoutesReachableIntegrationTest extends KernelTestCase
{
public function setUp(): void
{
self::bootKernel();
}
public function testAllAPIRoutePossibilities()
public function testAllRoutePossibilities()
{
foreach (LayerType::getChoices() as $layer => $layerDescription) {
$this->controller($layer);
@@ -52,8 +52,9 @@ class ApiUrlReachableIntegrationTest extends KernelTestCase
private function language(string $entity, string $method): void
{
//$this->type('api/'.$entity, $method);
foreach (LanguageType::getChoices() as $language => $value) {
foreach (LanguageType::getChoices() as $language) {
$this->type("$language/api/$entity", $method);
$this->type("$language/html/$entity", $method);
}
}