infinito/application/tests/unit/Entity/UserTest.php

39 lines
721 B
PHP
Raw Normal View History

2018-09-06 15:22:51 +02:00
<?php
2018-09-12 22:25:22 +02:00
2018-09-06 15:22:51 +02:00
namespace tests\unit\Entity;
use PHPUnit\Framework\TestCase;
use App\Entity\User;
/**
* @author kevinfrantz
*/
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
/**
* @var User
*/
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();
$this->user->setPassword(self::PASSWORD);
$this->user->setUsername(' '.self::USERNAME.' ');
2018-09-06 15:22:51 +02:00
}
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
}
}