mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized test structure
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class DefaultControllerTest extends WebTestCase
|
||||
{
|
||||
/**
|
||||
* @var DefaultControllerInterface
|
||||
*/
|
||||
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();
|
||||
$client->request('GET', '/imprint');
|
||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||
}
|
||||
}
|
||||
|
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Controller\UserController;
|
||||
use App\Controller\UserControllerInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class UserControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var UserControllerInterface
|
||||
*/
|
||||
protected $userController;
|
||||
|
||||
public function setUp():void{
|
||||
$this->userController = new UserController();
|
||||
}
|
||||
|
||||
public function testLogout(): void
|
||||
{
|
||||
$this->assertEquals(true, $this->userController->logout()->isSuccessful());
|
||||
}
|
||||
|
||||
public function testLogin(): void
|
||||
{
|
||||
$this->assertEquals(true, $this->userController->login()->isSuccessful());
|
||||
}
|
||||
|
||||
public function testRegister():void
|
||||
{
|
||||
$this->assertEquals(true, $this->userController->register()->isSuccessful());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user