You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
980 B
40 lines
980 B
<?php
|
|
|
|
namespace Coffee;
|
|
|
|
// This is not necessary, since it is bootstrapped but serves for debugging purposes
|
|
require __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
class TileTest extends \PHPUnit_Framework_TestCase {
|
|
|
|
public function testRepresentingSpot() {
|
|
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
|
|
|
|
$this->assertTrue($tile->isRepresentingSpot());
|
|
}
|
|
|
|
public function testRepresentingVoid() {
|
|
$tile = new Tile(2, 2, Tile::REPRESENTS_VOID);
|
|
|
|
$this->assertTrue($tile->isRepresentingVoid());
|
|
}
|
|
|
|
public function testGetPosition() {
|
|
$row = 2;
|
|
$column = 2;
|
|
|
|
$tile = new Tile($row, $column, Tile::REPRESENTS_VOID);
|
|
$position = new Position($row, $column);
|
|
|
|
$this->assertEquals($position, $tile->getPosition());
|
|
|
|
}
|
|
|
|
public function testIsVisited() {
|
|
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
|
|
$tile->visit();
|
|
|
|
$this->assertTrue($tile->isVisited());
|
|
}
|
|
|
|
}
|
|
|