You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
690 B
24 lines
690 B
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use classes\Player;
|
|
|
|
final class testPlayer extends TestCase
|
|
{
|
|
public function testInstanciation()
|
|
{
|
|
$player = new Player(1, "player", "player");
|
|
$this->assertInstanceOf(Player::class, $player);
|
|
$this->assertEquals(1, $player->getId());
|
|
$this->assertEquals("player", $player->getNickname());
|
|
$this->assertTrue(password_verify("player", $player->getHashedPassword()));
|
|
}
|
|
|
|
public function testSetter()
|
|
{
|
|
$player = new Player(1, "player", "player");
|
|
$player->setHashedPassword("bobby");
|
|
$this->assertTrue(password_verify("bobby", $player->getHashedPassword()));
|
|
}
|
|
}
|