Timothy J. Warren
457560137d
All checks were successful
timw4mail/php-kilo/pipeline/head This commit looks good
25 lines
471 B
PHP
25 lines
471 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Aviat\Kilo\Tests\Type;
|
|
|
|
use Aviat\Kilo\Type\Point;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class PointTest extends TestCase {
|
|
public function testNewPoint(): void
|
|
{
|
|
$p = Point::new(1, 2);
|
|
$this->assertEquals(1, $p->x);
|
|
$this->assertEquals(2, $p->y);
|
|
}
|
|
|
|
public function testPointFrom(): void
|
|
{
|
|
$p = Point::new(3, 7);
|
|
$p2 = Point::from($p);
|
|
|
|
$this->assertEquals($p->x, $p2->x);
|
|
$this->assertEquals($p->y, $p2->y);
|
|
}
|
|
}
|