Skip to content

Instantly share code, notes, and snippets.

@wodor
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save wodor/9750982 to your computer and use it in GitHub Desktop.

Select an option

Save wodor/9750982 to your computer and use it in GitHub Desktop.
<?php
namespace WodorNet\Vindinium;
class Board
{
public function getSurroundingPassableTiles(Position $position)
{
foreach ($this->surroundingTiles($position) as $tile) {
if ($tile->isPassable()) {
yield $tile;
}
}
}
}
Do you want me to create `Generator::hasCount()` for you?
[PhpSpec\Exception\Example\ErrorException]
warning: file_get_contents(/Users/wodor/prg/vindinium-starter-php/src/Generator.php): failed to open stream: No such file or directory in /Users/wodor/prg/vindinium-starter-php/vendor/phpspec/phpspec/src/PhpSpec/Util/Filesystem.php line 39
<?php
class BoardSpec extends ObjectBehavior
{
function it_finds_surrounding_passable_tiles()
{
$this->getSurroundingPassableTiles(new Position(3,3))
->shouldHaveCount(2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment