tests/GameOfLife/Inputs/BoardEditor/Options/ExitOptionTest.php
/**
     * Checks whether the option can exit the board editor.
     *
     * @covers \BoardEditor\Options\ExitOption::exitBoardEditor()
     *
     * @throws \Exception
     */
Checks whether the option can exit the board editor.

@throws \Exception
Checks whether the option can exit the board editor . @throws \ Exception
public function testCanExitBoardEditor()
    {
        $testBoard = new Board(4, 4, 4, true);
        $testBoard->setField(1, 1, true);
        $this->assertEquals(1, $testBoard->getAmountCellsAlive());
        $boardEditor = new BoardEditor("test", $testBoard);
        $option = new ExitOption($boardEditor);
        $result = $option->exitBoardEditor();
        $this->assertTrue($result);
        $this->assertEquals(0, $testBoard->getAmountCellsAlive());
    }
public function testCanExitBoardEditor ( ) { $ testBoard = new Board ( 4 , 4 , 4 , true ) ; $ testBoard -> setField ( 1 , 1 , true ) ; $ this -> assertEquals ( 1 , $ testBoard -> getAmountCellsAlive ( ) ) ; $ boardEditor = new BoardEditor ( " test " , $ testBoard ) ; $ option = new ExitOption ( $ boardEditor ) ; $ result = $ option -> exitBoardEditor ( ) ; $ this -> assertTrue ( $ result ) ; $ this -> assertEquals ( 0 , $ testBoard -> getAmountCellsAlive ( ) ) ; }
Checks whether the option can exit the board editor.
Checks whether the option can exit the board editor .