mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 01:09:41 +00:00 
			
		
		
		
	Implemented tests for user
This commit is contained in:
		| @@ -18,7 +18,7 @@ trait UsernameAttribut{ | ||||
|         return $this->username; | ||||
|     } | ||||
|      | ||||
|     public function setUsernames(string $username):void{ | ||||
|     public function setUsername(string $username):void{ | ||||
|         $this->username = $username; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -15,11 +15,6 @@ class User extends AbstractSource implements UserInterface | ||||
| { | ||||
|     use UsernameAttribut,PasswordAttribut; | ||||
|   | ||||
|     /** | ||||
|      * @ORM\Column(type="string", length=254, unique=true) | ||||
|      */ | ||||
|     private $email; | ||||
|  | ||||
|     /** | ||||
|      * @ORM\Column(name="is_active", type="boolean") | ||||
|      */ | ||||
|   | ||||
							
								
								
									
										38
									
								
								application/tests/unit/Entity/UserTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								application/tests/unit/Entity/UserTest.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| <?php | ||||
| namespace tests\unit\Entity; | ||||
|  | ||||
| use PHPUnit\Framework\TestCase; | ||||
| use App\Entity\User; | ||||
|  | ||||
| /** | ||||
|  * | ||||
|  * @author kevinfrantz | ||||
|  *         | ||||
|  */ | ||||
| class UserTest extends TestCase | ||||
| { | ||||
|     const PASSWORD = '12345678'; | ||||
|      | ||||
|     const USERNAME = 'tester'; | ||||
|      | ||||
|     /** | ||||
|      *  | ||||
|      * @var User | ||||
|      */ | ||||
|     protected $user; | ||||
|      | ||||
|     public function setUp():void{ | ||||
|         $this->user = new User(); | ||||
|         $this->user->setPassword(self::PASSWORD); | ||||
|         $this->user->setUsername(self::USERNAME); | ||||
|     } | ||||
|      | ||||
|     public function testUsername():void{ | ||||
|         $this->assertEquals(self::USERNAME,$this->user->getUsername()); | ||||
|     } | ||||
|      | ||||
|     public function testPassword():void{ | ||||
|         $this->assertEquals(self::PASSWORD,$this->user->getPassword()); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user