mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-11-01 00:53:10 +01:00
Added tests for user
This commit is contained in:
parent
72f6a71839
commit
233d8b3c0e
33
src/entity/user/User.php
Normal file
33
src/entity/user/User.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace entity\user;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
final class User implements UserInterface
|
||||
{
|
||||
public function setName(string $name): void
|
||||
{}
|
||||
|
||||
public function getName(): string
|
||||
{}
|
||||
|
||||
public function setEmail(string $email): void
|
||||
{}
|
||||
|
||||
public function getPasswordHash(): string
|
||||
{}
|
||||
|
||||
public function setPasswordHash(string $hash): void
|
||||
{}
|
||||
|
||||
public function getEmail(): string
|
||||
{}
|
||||
|
||||
public function getId(): int
|
||||
{}
|
||||
|
||||
}
|
||||
|
44
src/entity/user/UserTest.php
Normal file
44
src/entity/user/UserTest.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace entity\user;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
class UserTest extends TestCase
|
||||
{
|
||||
const NAME = 'testuser';
|
||||
|
||||
const EMAIL = 'test@mail.world';
|
||||
|
||||
const HASH = '1235';
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
protected function setUp(){
|
||||
$this->user = new User();
|
||||
$this->user->setName(self::NAME);
|
||||
$this->user->setEmail(self::EMAIL);
|
||||
$this->user->setPasswordHash(self::HASH);
|
||||
}
|
||||
|
||||
public function testName():void{
|
||||
$this->assertEquals(self::NAME, $this->user->getName());
|
||||
}
|
||||
|
||||
public function testEmail():void{
|
||||
$this->assertEquals(self::EMAIL, $this->user->getEmail());
|
||||
}
|
||||
|
||||
public function testHash():void{
|
||||
$this->assertEquals(self::HASH, $this->user->getPasswordHash());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user