tests/GameOfLife/FieldTest.php
/**
     * Checks whether the number of border neighbors is correctly returned.
     *
     * @param int $_fieldX The X-Coordinate of the field that will be checked
     * @param int $_fieldY The Y-Coordinate of the field that will be checked
     * @param bool $_hasBorder Sets whether the test board has a border or not
     * @param int $_expectedResult The expected number of border neighbors
     *
     * @covers \GameOfLife\Field::numberOfNeighborBorderFields()
     *
     * @dataProvider getNumberOfBorderNeighborsProvider
     */
Checks whether the number of border neighbors is correctly returned.
@param int $_fieldX The X-Coordinate of the field that will be checked
@param int $_fieldY The Y-Coordinate of the field that will be checked
@param bool $_hasBorder Sets whether the test board has a border or not
@param int $_expectedResult The expected number of border neighbors




Checks whether the number of border neighbors is correctly returned . @param int $_fieldX The X - Coordinate of the field that will be checked @param int $_fieldY The Y - Coordinate of the field that will be checked @param bool $_hasBorder Sets whether the test board has a border or not @param int $_expectedResult The expected number of border neighbors
public function testCanGetNumberOfBorderNeighbors(int $_fieldX, int $_fieldY, bool $_hasBorder, int $_expectedResult)
    {
        $board = new Board(10, 10, 0, $_hasBorder);
        $checkField = $board->fields()[$_fieldY][$_fieldX];
        $this->assertEquals($_expectedResult, $checkField->numberOfNeighborBorderFields());
    }
public function testCanGetNumberOfBorderNeighbors ( int $ _fieldX , int $ _fieldY , bool $ _hasBorder , int $ _expectedResult ) { $ board = new Board ( 10 , 10 , 0 , $ _hasBorder ) ; $ checkField = $ board -> fields ( ) [ $ _fieldY ] [ $ _fieldX ] ; $ this -> assertEquals ( $ _expectedResult , $ checkField -> numberOfNeighborBorderFields ( ) ) ; }
Checks whether the number of border neighbors is correctly returned.
Checks whether the number of border neighbors is correctly returned .
/** @var Field $checkField */