mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 09:19:08 +00:00 
			
		
		
		
	Implemented tests for UserController
This commit is contained in:
		| @@ -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()); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user