| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-06 23:38:04 +01:00
										 |  |  | namespace Tests\FFMpeg\Functional; | 
					
						
							| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | use FFMpeg\FFProbe; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class FFProbeTest extends FunctionalTestCase | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     public function testProbeOnFile() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $ffprobe = FFProbe::create(); | 
					
						
							| 
									
										
										
										
											2016-03-06 23:38:04 +01:00
										 |  |  |         $this->assertGreaterThan(0, count($ffprobe->streams(__DIR__ . '/../files/Audio.mp3'))); | 
					
						
							| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-19 19:28:34 +02:00
										 |  |  |     public function testValidateExistingFile() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $ffprobe = FFProbe::create(); | 
					
						
							|  |  |  |         $this->assertTrue($ffprobe->isValid(__DIR__ . '/../files/sample.3gp')); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function testValidateNonExistingFile() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $ffprobe = FFProbe::create(); | 
					
						
							|  |  |  |         $this->assertFalse($ffprobe->isValid(__DIR__ . '/../files/WrongFile.mp4')); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * @expectedException FFMpeg\Exception\RuntimeException | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-09-19 19:28:34 +02:00
										 |  |  |     public function testProbeOnNonExistantFile() | 
					
						
							| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |         $ffprobe = FFProbe::create(); | 
					
						
							|  |  |  |         $ffprobe->streams('/path/to/no/file'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function testProbeOnRemoteFile() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $ffprobe = FFProbe::create(); | 
					
						
							| 
									
										
										
										
											2016-03-05 18:03:41 +01:00
										 |  |  |         $this->assertGreaterThan(0, count($ffprobe->streams('http://vjs.zencdn.net/v/oceans.mp4'))); | 
					
						
							| 
									
										
										
										
											2013-08-05 14:36:27 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } |