public function testGetters() { $steampunked = new Steampunked(self::SEED); $steampunked->setSize(12, 10); $this->assertEquals(10, $steampunked->getHeight()); $this->assertEquals(12, $steampunked->getWidth()); //The sizes should be different to ensure that the getters fetch the correct size }
public function test_construct() { $steampunked = new Steampunked(self::SEED); $steampunked->setSize(6, 6); $this->assertEquals(6, $steampunked->getHeight()); $this->assertEquals(6, $steampunked->getWidth()); $steampunkedView = new SteampunkedView($steampunked); $this->assertContains('<div class="game"><div class="row">', $steampunkedView->gameGrid()); $this->assertContains('<img src="images/valve-closed.png">', $steampunkedView->gameGrid()); $this->assertContains('', $steampunkedView->gameGrid()); $this->assertContains('<input type=\\"submit\\" name=\\"rotate\\" id=\\"rotate\\" value=\\"Rotate\\">', $steampunkedView->gameButtons()); $this->assertContains('<input type="submit" name="discard" id="discard" value="Discard">', $steampunkedView->gameButtons()); $this->assertContains('<input type="submit" name="openValve" id="openValve" value="Open Valve">', $steampunkedView->gameButtons()); $this->assertContains('<input type="submit" name="giveUp" id="giveUp" value="Give Up">', $steampunkedView->gameButtons()); }