mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-08 13:51:34 +01:00
Implemented tests for UserController
This commit is contained in:
parent
fc3f7f3898
commit
87fd2e121b
@ -10,6 +10,9 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
class DefaultControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var DefaultControllerInterface
|
||||
*/
|
||||
protected $defaultController;
|
||||
|
||||
public function setUp():void{
|
||||
|
@ -10,29 +10,13 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
*/
|
||||
class UserController implements UserControllerInterface
|
||||
{
|
||||
public function modify(int $id): Response
|
||||
{}
|
||||
|
||||
public function logout(): Response
|
||||
{}
|
||||
|
||||
public function activate(): Response
|
||||
{}
|
||||
|
||||
public function create(): Response
|
||||
{}
|
||||
|
||||
public function login(): Response
|
||||
{}
|
||||
|
||||
public function delete(): Response
|
||||
{}
|
||||
|
||||
public function register(): Response
|
||||
{}
|
||||
|
||||
public function deactivate(): Response
|
||||
{}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -8,7 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface UserControllerInterface extends CreationInterface, ActivationInterface,ModificationInterface
|
||||
interface UserControllerInterface
|
||||
{
|
||||
public function logout():Response;
|
||||
|
||||
|
40
application/src/Controller/UserControllerTest.php
Normal file
40
application/src/Controller/UserControllerTest.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace 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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user