diff options
author | FBeans <phil@pgburton.com> | 2022-05-21 19:07:32 +0100 |
---|---|---|
committer | FBeans <phil@pgburton.com> | 2022-05-21 19:07:32 +0100 |
commit | 02455892dac1d52914e5702fd8e895d5cee1f083 (patch) | |
tree | 5cbafc717c099ee42c32ee21270b569a55089261 /tests/World/WorldTest.php | |
parent | 5832634b35b475f607f4c695ccad310ee2467e57 (diff) |
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()); + } +} |