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


Checks whether the ffmpeg helper can find the ffmpeg binary for windows . @throws \ Exception
public function testCanFindFfmpegBinaryForWindows()
    {
        $ffmpegHelper = new FfmpegHelper("test");
        $fileSystemHandlerMock = $this->getMockBuilder(\Utils\FileSystem\FileSystemReader::class)
                                      ->getMock();
        $fileSystemHandlerMock->expects($this->exactly(1))
                              ->method("findFileRecursive")
                              ->willReturn("ffmpeg.exe");
        setPrivateAttribute($ffmpegHelper, "fileSystemReader", $fileSystemHandlerMock);
        setPrivateAttribute($ffmpegHelper, "osName", "Windows");
        $reflectionClass = new ReflectionClass(\Output\Helpers\FfmpegHelper::class);
        $reflectionMethod = $reflectionClass->getMethod("findFfmpegBinary");
        $reflectionMethod->setAccessible(true);
        $result = $reflectionMethod->invoke($ffmpegHelper);
        $this->assertEquals("ffmpeg.exe", $result);
    }
public function testCanFindFfmpegBinaryForWindows ( ) { $ ffmpegHelper = new FfmpegHelper ( " test " ) ; $ fileSystemHandlerMock = $ this -> getMockBuilder ( \ Utils \ FileSystem \ FileSystemReader :: class ) -> getMock ( ) ; $ fileSystemHandlerMock -> expects ( $ this -> exactly ( 1 ) ) -> method ( " findFileRecursive " ) -> willReturn ( " ffmpeg.exe " ) ; setPrivateAttribute ( $ ffmpegHelper , " fileSystemReader " , $ fileSystemHandlerMock ) ; setPrivateAttribute ( $ ffmpegHelper , " osName " , " Windows " ) ; $ reflectionClass = new ReflectionClass ( \ Output \ Helpers \ FfmpegHelper :: class ) ; $ reflectionMethod = $ reflectionClass -> getMethod ( " findFfmpegBinary " ) ; $ reflectionMethod -> setAccessible ( true ) ; $ result = $ reflectionMethod -> invoke ( $ ffmpegHelper ) ; $ this -> assertEquals ( " ffmpeg.exe " , $ result ) ; }
Checks whether the ffmpeg helper can find the ffmpeg binary for windows.
Checks whether the ffmpeg helper can find the ffmpeg binary for windows .