tests/GameOfLife/Inputs/TemplateInputTest.php
/**
     * @dataProvider invalidTemplateNamesProvider
     *
     * @param string $_templateName     Name of the template
     *
     * @throws \Exception
     */
@dataProvider invalidTemplateNamesProvider
@param string $_templateName     Name of the template

@throws \Exception
@dataProvider invalidTemplateNamesProvider @param string $_templateName Name of the template @throws \ Exception
public function testDetectsInvalidTemplateNames(string $_templateName)
    {
        $this->optionsMock->expects($this->exactly(2))
                          ->method("getOption")
                          ->withConsecutive(array("template"), array("template"))
                          ->willReturn($_templateName, $_templateName);
        if ($this->optionsMock instanceof Getopt)
        {
            $exceptionOccurred = false;
            try
            {
                $this->input->fillBoard($this->board, $this->optionsMock);
            }
            catch (\Exception $_exception)
            {
                $exceptionOccurred = true;
                $this->assertEquals("The template file could not be found.", $_exception->getMessage());
            }
            $this->assertTrue($exceptionOccurred);
        }
    }
public function testDetectsInvalidTemplateNames ( string $ _templateName ) { $ this -> optionsMock -> expects ( $ this -> exactly ( 2 ) ) -> method ( " getOption " ) -> withConsecutive ( array ( " template " ) , array ( " template " ) ) -> willReturn ( $ _templateName , $ _templateName ) ; if ( $ this -> optionsMock instanceof Getopt ) { $ exceptionOccurred = false ; try { $ this -> input -> fillBoard ( $ this -> board , $ this -> optionsMock ) ; } catch ( \ Exception $ _exception ) { $ exceptionOccurred = true ; $ this -> assertEquals ( " The template file could not be found. " , $ _exception -> getMessage ( ) ) ; } $ this -> assertTrue ( $ exceptionOccurred ) ; } }
@dataProvider invalidTemplateNamesProvider
 @param string $_templateName     Name of the template
@dataProvider invalidTemplateNamesProvider @param string $_templateName Name of the template