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.
coffee-table/tests/TableTest.php

72 lines
1.3 KiB

<?php
namespace Coffee;
/**
* Created by PhpStorm.
* User: delmadord
* Date: 3/16/16
* Time: 7:59 AM
*/
class TableTest extends \PHPUnit_Framework_TestCase {
public function testGetSpots() {
$tableMap = [
[1, 0],
[0, 1],
];
$tile = new Tile(0, 0);
$spot = new Spot();
$table = new Table($tableMap);
$spot->addTile($tile);
$table->addSpot($spot);
$this->assertEquals([$spot], $table->getSpots());
}
public function testSpotsCount() {
$tableMap = [
[1, 0],
[0, 1],
];
$tile = new Tile(0, 0);
$spot = new Spot();
$table = new Table($tableMap);
$spot->addTile($tile);
$table->addSpot($spot);
$table->addSpot($spot);
$this->assertEquals(2, $table->getSpotsCount());
}
// public function testRemoveMapCoordinate() {
// $tableMap = [
// [1, 0],
// [0, 1],
// ];
//
// $table = new Table($tableMap);
// $table->processCoordinate(0, 0);
//
// $processedTableMap = [
// [0],
// [0, 1],
// ];
//
// $this->assertEquals($processedTableMap, $table->getRemainingPositions());
// }
// public function testConvertCoffeeTileToSpot() {
// $tableMap = [
// [1, 0],
// [0, 1],
// ];
//
// $tile = new Tile(0, 0);
// $spot = new Spot();
// $table = new Table($tableMap);
// $spot->addTile($tile);
// $table->addSpot($spot);
// $table->addSpot($spot);
// $this->assertEquals(2, $table->getSpotsCount());
// }
}