tests/GameOfLife/Inputs/TemplateInputTest.php
/**
     * Checks whether a default template can be loaded by its linked options.
     *
     * @covers \Input\TemplateInput::fillBoard()
     * @covers \Input\TemplateInput::placeTemplate()
     * @covers \Input\TemplateInput::getTemplateNameFromLinkedOption()
     *
     * @throws \Exception
     */
Checks whether a default template can be loaded by its linked options.

@throws \Exception
Checks whether a default template can be loaded by its linked options . @throws \ Exception
public function testCanLoadDefaultTemplatesFromLinkedOption()
    {
        $optionsMock = $this->getMockBuilder(Ulrichsg\Getopt::class)
                            ->getMock();
        $optionsMock->expects($this->exactly(9))
            ->method("getOption")
            ->withConsecutive(
                array("template"), array("list-templates"), array("input"), array("unittestPosX"),
                array("unittestPosX"), array("unittestPosX"), array("unittestPosY"), array("unittestPosY"),
                array("invertTemplate")
            )
            ->willReturn(null, null, null, 5, 5, 5, 3, 3, null, null, null);
        $board = new Board(10, 8, 5, true);
        if ($optionsMock instanceof \Ulrichsg\Getopt) $this->input->fillBoard($board, $optionsMock);
        $this->assertTrue($board->getFieldStatus(5, 3));
    }
public function testCanLoadDefaultTemplatesFromLinkedOption ( ) { $ optionsMock = $ this -> getMockBuilder ( Ulrichsg \ Getopt :: class ) -> getMock ( ) ; $ optionsMock -> expects ( $ this -> exactly ( 9 ) ) -> method ( " getOption " ) -> withConsecutive ( array ( " template " ) , array ( " list-templates " ) , array ( " input " ) , array ( " unittestPosX " ) , array ( " unittestPosX " ) , array ( " unittestPosX " ) , array ( " unittestPosY " ) , array ( " unittestPosY " ) , array ( " invertTemplate " ) ) -> willReturn ( null , null , null , 5 , 5 , 5 , 3 , 3 , null , null , null ) ; $ board = new Board ( 10 , 8 , 5 , true ) ; if ( $ optionsMock instanceof \ Ulrichsg \ Getopt ) $ this -> input -> fillBoard ( $ board , $ optionsMock ) ; $ this -> assertTrue ( $ board -> getFieldStatus ( 5 , 3 ) ) ; }
Checks whether a default template can be loaded by its linked options.
Checks whether a default template can be loaded by its linked options .