Initial import from aternosorg/codex-minecraft
This commit is contained in:
33
test/tests/Log/LineTest.php
Normal file
33
test/tests/Log/LineTest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Codex\Test\Tests\Log;
|
||||
|
||||
use Aternos\Codex\Log\Line;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class LineTest extends TestCase
|
||||
{
|
||||
public function testSetGetText(): void
|
||||
{
|
||||
$text = uniqid();
|
||||
$line = new Line(1, "");
|
||||
$this->assertSame($line, $line->setText($text));
|
||||
$this->assertEquals($text, $line->getText());
|
||||
}
|
||||
|
||||
public function testSetGetNumber(): void
|
||||
{
|
||||
$number = rand(0, 100);
|
||||
$line = new Line(999, "");
|
||||
$this->assertSame($line, $line->setNumber($number));
|
||||
$this->assertEquals($number, $line->getNumber());
|
||||
}
|
||||
|
||||
public function test__toString(): void
|
||||
{
|
||||
$text = uniqid();
|
||||
$line = new Line(1, $text);
|
||||
$this->assertSame($line, $line->setText($text));
|
||||
$this->assertEquals($text, (string)$line);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user