tests/GameOfLife/Outputs/ImageOutputTest.php
/**
     * Checks whether the default values are successfully set.
     *
     * @covers \Output\ImageOutput::startOutput()
     *
     * @throws \ReflectionException
     */
Checks whether the default values are successfully set.


Checks whether the default values are successfully set .
public function testCanSetDefaultValues()
    {
        $optionsMock = $this->getMockBuilder(\Ulrichsg\Getopt::class)
                            ->getMock();
        $optionsMock->expects($this->exactly(4))
                    ->method("getOption")
                    ->withConsecutive(["testOutputSize"], ["testOutputCellColor"], ["testOutputBackgroundColor"], ["testOutputGridColor"])
                    ->willReturn(null, null, null, null);
        $board = new Board(1,1,1,true);
        $this->expectOutputRegex("/.*/");
        if ($optionsMock instanceof Getopt) $this->output->startOutput($optionsMock, $board);
        $imageCreator = $this->output->imageCreator();
        $this->assertEquals(100, \getPrivateAttribute($imageCreator, "cellSize"));
    }
public function testCanSetDefaultValues ( ) { $ optionsMock = $ this -> getMockBuilder ( \ Ulrichsg \ Getopt :: class ) -> getMock ( ) ; $ optionsMock -> expects ( $ this -> exactly ( 4 ) ) -> method ( " getOption " ) -> withConsecutive ( [ " testOutputSize " ] , [ " testOutputCellColor " ] , [ " testOutputBackgroundColor " ] , [ " testOutputGridColor " ] ) -> willReturn ( null , null , null , null ) ; $ board = new Board ( 1 , 1 , 1 , true ) ; $ this -> expectOutputRegex ( " /.*/ " ) ; if ( $ optionsMock instanceof Getopt ) $ this -> output -> startOutput ( $ optionsMock , $ board ) ; $ imageCreator = $ this -> output -> imageCreator ( ) ; $ this -> assertEquals ( 100 , \ getPrivateAttribute ( $ imageCreator , " cellSize " ) ) ; }
Checks whether the default values are successfully set.
Checks whether the default values are successfully set .
// Hide output