tests/GameOfLife/Outputs/Helpers/FfmpegHelperTest.php
/**
     * Checks whether the ffmpeg helper can find the ffmpeg binary for linux.
     *
     * @throws \Exception
     *
     * @covers \Output\Helpers\FfmpegHelper::findFFmpegBinary()
     */
Checks whether the ffmpeg helper can find the ffmpeg binary for linux.
@throws \Exception


Checks whether the ffmpeg helper can find the ffmpeg binary for linux . @throws \ Exception
public function testCanFindFfmpegBinaryForLinux()
    {
        $ffmpegHelper = new FfmpegHelper("test");
        $reflectionClass = new ReflectionClass(\Output\Helpers\FfmpegHelper::class);
        $shellExecutorMock = $this->getMockBuilder(\Utils\Shell\ShellExecutor::class)
                                  ->setConstructorArgs(array(PHP_OS))
                                  ->getMock();
        $shellExecutorMock->expects($this->exactly(1))
                          ->method("executeCommand")
                          ->willReturn(1);
        $reflectionProperty = $reflectionClass->getProperty("shellExecutor");
        $reflectionProperty->setAccessible(true);
        $reflectionProperty->setValue($ffmpegHelper, $shellExecutorMock);
        $reflectionProperty = $reflectionClass->getProperty("osName");
        $reflectionProperty->setAccessible(true);
        $reflectionProperty->setValue($ffmpegHelper, "Linux");
        $reflectionMethod = $reflectionClass->getMethod("findFfmpegBinary");
        $reflectionMethod->setAccessible(true);
        $result = $reflectionMethod->invoke($ffmpegHelper);
        $this->assertEquals("ffmpeg", $result);
    }
public function testCanFindFfmpegBinaryForLinux ( ) { $ ffmpegHelper = new FfmpegHelper ( " test " ) ; $ reflectionClass = new ReflectionClass ( \ Output \ Helpers \ FfmpegHelper :: class ) ; $ shellExecutorMock = $ this -> getMockBuilder ( \ Utils \ Shell \ ShellExecutor :: class ) -> setConstructorArgs ( array ( PHP_OS ) ) -> getMock ( ) ; $ shellExecutorMock -> expects ( $ this -> exactly ( 1 ) ) -> method ( " executeCommand " ) -> willReturn ( 1 ) ; $ reflectionProperty = $ reflectionClass -> getProperty ( " shellExecutor " ) ; $ reflectionProperty -> setAccessible ( true ) ; $ reflectionProperty -> setValue ( $ ffmpegHelper , $ shellExecutorMock ) ; $ reflectionProperty = $ reflectionClass -> getProperty ( " osName " ) ; $ reflectionProperty -> setAccessible ( true ) ; $ reflectionProperty -> setValue ( $ ffmpegHelper , " Linux " ) ; $ reflectionMethod = $ reflectionClass -> getMethod ( " findFfmpegBinary " ) ; $ reflectionMethod -> setAccessible ( true ) ; $ result = $ reflectionMethod -> invoke ( $ ffmpegHelper ) ; $ this -> assertEquals ( " ffmpeg " , $ result ) ; }
Checks whether the ffmpeg helper can find the ffmpeg binary for linux.
Checks whether the ffmpeg helper can find the ffmpeg binary for linux .