2018-09-06 15:22:51 +02:00
|
|
|
<?php
|
2018-09-21 19:43:48 +02:00
|
|
|
|
2018-09-06 15:22:51 +02:00
|
|
|
namespace tests\unit\Entity;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use App\Entity\User;
|
2018-10-03 16:14:15 +02:00
|
|
|
use App\Entity\Source\UserSource;
|
2018-10-28 20:28:29 +01:00
|
|
|
use App\Entity\UserInterface;
|
2018-09-06 15:22:51 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
2018-10-28 15:25:32 +01:00
|
|
|
use App\Entity\Source\UserSource;
|
2018-09-06 15:22:51 +02:00
|
|
|
*/
|
|
|
|
class UserTest extends TestCase
|
|
|
|
{
|
|
|
|
const PASSWORD = '12345678';
|
2018-09-12 22:25:22 +02:00
|
|
|
|
2018-09-06 15:22:51 +02:00
|
|
|
const USERNAME = 'tester';
|
2018-09-12 22:25:22 +02:00
|
|
|
|
2018-09-06 15:22:51 +02:00
|
|
|
/**
|
2018-10-28 20:28:29 +01:00
|
|
|
* @var UserInterface
|
2018-09-06 15:22:51 +02:00
|
|
|
*/
|
|
|
|
protected $user;
|
2018-09-12 22:25:22 +02:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
2018-09-06 15:22:51 +02:00
|
|
|
$this->user = new User();
|
2018-10-28 20:28:29 +01:00
|
|
|
$this->user->setUsername(self::USERNAME);
|
|
|
|
$this->user->setPassword(self::PASSWORD);
|
|
|
|
|
2018-09-06 15:22:51 +02:00
|
|
|
}
|
2018-10-28 22:13:33 +01:00
|
|
|
|
|
|
|
public function testConstructor():void{
|
|
|
|
$this->assertInstanceOf(UserInterface::class, new User());
|
|
|
|
}
|
2018-09-12 22:25:22 +02:00
|
|
|
|
|
|
|
public function testUsername(): void
|
|
|
|
{
|
|
|
|
$this->assertEquals(self::USERNAME, $this->user->getUsername());
|
2018-09-06 15:22:51 +02:00
|
|
|
}
|
2018-09-12 22:25:22 +02:00
|
|
|
|
|
|
|
public function testPassword(): void
|
|
|
|
{
|
|
|
|
$this->assertEquals(self::PASSWORD, $this->user->getPassword());
|
2018-09-06 15:22:51 +02:00
|
|
|
}
|
2018-09-21 19:43:48 +02:00
|
|
|
|
2018-09-21 19:28:57 +02:00
|
|
|
public function testSource(): void
|
|
|
|
{
|
2018-09-21 19:43:48 +02:00
|
|
|
$this->assertInstanceOf(UserSource::class, $this->user->getSource());
|
2018-09-21 19:28:57 +02:00
|
|
|
}
|
2018-09-06 15:22:51 +02:00
|
|
|
}
|