blob: c2b117e8f560f2c3662d88b31f6e47c92c4b2791 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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());
}
}
|