tests/GameOfLife/GameLogicTest.php
/**
     * Checks whether getters and setters work as expected.
     *
     * @covers \GameOfLife\GameLogic::setCurrentBoard()
     * @covers \GameOfLife\GameLogic::setHistoryOfBoards()
     * @covers \GameOfLife\GameLogic::currentBoard()
     * @covers \GameOfLife\GameLogic::historyOfBoards()
     * @covers \GameOfLife\GameLogic::setRule()
     * @covers \GameOfLife\GameLogic::rule()
     */
Checks whether getters and setters work as expected.
Checks whether getters and setters work as expected .
public function testCanSetAttributes()
    {
        $gameLogic = new GameLogic(new ConwayRule());
        $board = new Board(5, 5, 1, true);
        $fields = (string)$board;
        $historyTest = array($fields, $fields, $fields, $fields);
        $gameLogic->setCurrentBoard($fields);
        $gameLogic->setHistoryOfBoards($historyTest);
        $gameLogic->setRule(new ConwayRule());
        $this->assertEquals($fields, $gameLogic->currentBoard());
        $this->assertEquals($historyTest, $gameLogic->historyOfBoards());
        $this->assertEquals(new ConwayRule(), $gameLogic->rule());
    }
public function testCanSetAttributes ( ) { $ gameLogic = new GameLogic ( new ConwayRule ( ) ) ; $ board = new Board ( 5 , 5 , 1 , true ) ; $ fields = ( string ) $ board ; $ historyTest = array ( $ fields , $ fields , $ fields , $ fields ) ; $ gameLogic -> setCurrentBoard ( $ fields ) ; $ gameLogic -> setHistoryOfBoards ( $ historyTest ) ; $ gameLogic -> setRule ( new ConwayRule ( ) ) ; $ this -> assertEquals ( $ fields , $ gameLogic -> currentBoard ( ) ) ; $ this -> assertEquals ( $ historyTest , $ gameLogic -> historyOfBoards ( ) ) ; $ this -> assertEquals ( new ConwayRule ( ) , $ gameLogic -> rule ( ) ) ; }
Checks whether getters and setters work as expected.
Checks whether getters and setters work as expected .