php-kilo/tests/Type/PointTest.php

25 lines
471 B
PHP
Raw Permalink Normal View History

2021-04-14 19:00:37 -04:00
<?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);
}
}