tests/GameOfLife/BoardTest.php
/**
     * Checks whether the board can be inverted.
     *
     * @covers \GameOfLife\Board::invertBoard()
     */
Checks whether the board can be inverted.
Checks whether the board can be inverted .
public function testCanInvertBoard()
    {
        $board = new Board(2, 2, 1, true);
        $board->setField(1, 1, true);
        $fieldZeroZero = new Field(0, 0, true, $board);
        $fieldOneZero = new Field(1, 0, true, $board);
        $fieldZeroOne = new Field(0, 1, true, $board);
        $fieldOneOne = new Field(1, 1, false, $board);
        $expectedFields = array(
            array($fieldZeroZero, $fieldOneZero),
            array($fieldZeroOne, $fieldOneOne)
        );
        $board->invertBoard();
        $this->assertEquals($expectedFields, $board->fields());
    }
public function testCanInvertBoard ( ) { $ board = new Board ( 2 , 2 , 1 , true ) ; $ board -> setField ( 1 , 1 , true ) ; $ fieldZeroZero = new Field ( 0 , 0 , true , $ board ) ; $ fieldOneZero = new Field ( 1 , 0 , true , $ board ) ; $ fieldZeroOne = new Field ( 0 , 1 , true , $ board ) ; $ fieldOneOne = new Field ( 1 , 1 , false , $ board ) ; $ expectedFields = array ( array ( $ fieldZeroZero , $ fieldOneZero ) , array ( $ fieldZeroOne , $ fieldOneOne ) ) ; $ board -> invertBoard ( ) ; $ this -> assertEquals ( $ expectedFields , $ board -> fields ( ) ) ; }
Checks whether the board can be inverted.
Checks whether the board can be inverted .