Fix #44 : throw an exception in case of older ffprobe
This commit is contained in:
		
					parent
					
						
							
								8bb596a919
							
						
					
				
			
			
				commit
				
					
						3bdb341abb
					
				
			
		
					 2 changed files with 26 additions and 1 deletions
				
			
		|  | @ -2,11 +2,30 @@ | |||
| 
 | ||||
| namespace FFMpeg\Tests\FFProbe; | ||||
| 
 | ||||
| use Alchemy\BinaryDriver\Exception\ExecutionFailureException; | ||||
| use FFMpeg\Tests\TestCase; | ||||
| use FFMpeg\FFProbe\OptionsTester; | ||||
| 
 | ||||
| class OptionsTesterTest extends TestCase | ||||
| { | ||||
|     /** | ||||
|      * @expectedException FFMpeg\Exception\RuntimeException | ||||
|      * @expectedExceptionMessage Your FFProbe version is too old and does not support `-help` option, please upgrade. | ||||
|      */ | ||||
|     public function testHasOptionWithOldFFProbe() | ||||
|     { | ||||
|         $cache = $this->getCacheMock(); | ||||
| 
 | ||||
|         $ffprobe = $this->getFFProbeDriverMock(); | ||||
|         $ffprobe->expects($this->once()) | ||||
|             ->method('command') | ||||
|             ->with(array('-help', '-loglevel', 'quiet')) | ||||
|             ->will($this->throwException(new ExecutionFailureException('Failed to execute'))); | ||||
| 
 | ||||
|         $tester = new OptionsTester($ffprobe, $cache); | ||||
|         $tester->has('-print_format'); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @dataProvider provideOptions | ||||
|      */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue