tests/GameOfLife/GameLogicTest.php
/**
     * Checks whether max steps reached can be successfully detected.
     *
     * @covers \GameOfLife\GameLogic::isMaxStepsReached()
     */
Checks whether max steps reached can be successfully detected.
Checks whether max steps reached can be successfully detected .
public function testCanDetectMaxStepsReached()
    {
        $board = new Board(1, 1, 3, true);
        $gameLogic = new GameLogic(new ConwayRule());
        $board->setGameStep(1);
        $this->assertFalse($gameLogic->isMaxStepsReached($board));
        $board->setGameStep(2);
        $this->assertTrue($gameLogic->isMaxStepsReached($board));
        $board->setGameStep(14);
        $this->assertTrue($gameLogic->isMaxStepsReached($board));
    }
public function testCanDetectMaxStepsReached ( ) { $ board = new Board ( 1 , 1 , 3 , true ) ; $ gameLogic = new GameLogic ( new ConwayRule ( ) ) ; $ board -> setGameStep ( 1 ) ; $ this -> assertFalse ( $ gameLogic -> isMaxStepsReached ( $ board ) ) ; $ board -> setGameStep ( 2 ) ; $ this -> assertTrue ( $ gameLogic -> isMaxStepsReached ( $ board ) ) ; $ board -> setGameStep ( 14 ) ; $ this -> assertTrue ( $ gameLogic -> isMaxStepsReached ( $ board ) ) ; }
Checks whether max steps reached can be successfully detected.
Checks whether max steps reached can be successfully detected .
// Less than max steps // Equal to max steps // Greater than max steps