Added tests for user

This commit is contained in:
Kevin Frantz 2018-07-14 10:54:57 +02:00
parent 72f6a71839
commit 233d8b3c0e
2 changed files with 77 additions and 0 deletions

33
src/entity/user/User.php Normal file
View 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
{}
}

View 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());
}
}