diff options
Diffstat (limited to 'tests/World/WorldTest.php')
-rw-r--r-- | tests/World/WorldTest.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/World/WorldTest.php b/tests/World/WorldTest.php new file mode 100644 index 0000000..c2b117e --- /dev/null +++ b/tests/World/WorldTest.php @@ -0,0 +1,25 @@ +<?php + +namespace Tests\World; + +use App\World\World; +use PHPUnit\Framework\TestCase; + +class WorldTest extends TestCase +{ + public function testWorldConstruction() + { + $world = new World(1, 2, 'test-world'); + + $this->assertEquals('test-world', $world->name()); + $this->assertEquals(1, $world->width()); + $this->assertEquals(2, $world->height()); + + $world = new World(1, 2); + + $this->assertTrue(is_string($world->name())); + $this->assertTrue(strpos($world->name(), 'world') === 0); + $this->assertEquals(1, $world->width()); + $this->assertEquals(2, $world->height()); + } +} |