Fix #76 : Remove restriction on filesystem resources

This commit is contained in:
Romain Neutron 2013-11-29 11:14:49 +01:00
commit ad2b9e75a5
10 changed files with 36 additions and 49 deletions

View file

@ -3,6 +3,7 @@
namespace FFMpeg\Functional;
use FFMpeg\Format\Video\X264;
use FFMpeg\Media\Video;
class VideoTranscodeTest extends FunctionalTestCase
{
@ -35,4 +36,22 @@ class VideoTranscodeTest extends FunctionalTestCase
$this->assertFileExists($filename);
unlink($filename);
}
/**
* @expectedException \FFMpeg\Exception\RuntimeException
*/
public function testTranscodeInvalidFile()
{
$ffmpeg = $this->getFFMpeg();
$ffmpeg->open(__DIR__ . '/../../files/UnknownFileTest.ogv');
}
public function testSaveInvalidForgedVideo()
{
$ffmpeg = $this->getFFMpeg();
$video = new Video(__DIR__ . '/../../files/UnknownFileTest.ogv', $ffmpeg->getFFMpegDriver(), $ffmpeg->getFFProbe());
$this->setExpectedException('FFMpeg\Exception\RuntimeException');
$video->save(new X264('libvo_aacenc'), __DIR__ . '/output/output-x264.mp4');
}
}

View file

@ -10,7 +10,8 @@ use FFMpeg\FFProbe\DataMapping\Stream;
class FFMpegTest Extends TestCase
{
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
* @expectedException \FFMpeg\Exception\RuntimeException
* @expectedExceptionMessage Unable to probe "/path/to/unknown/file".
*/
public function testOpenInvalid()
{
@ -58,7 +59,7 @@ class FFMpegTest Extends TestCase
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
* @expectedException \FFMpeg\Exception\InvalidArgumentException
*/
public function testOpenUnknown()
{

View file

@ -6,5 +6,4 @@ use FFMpeg\Tests\TestCase;
abstract class AbstractMediaTestCase extends TestCase
{
abstract public function testWithInvalidFile();
}

View file

@ -9,17 +9,6 @@ use FFMpeg\Format\AudioInterface;
class AudioTest extends AbstractStreamableTestCase
{
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testWithInvalidFile()
{
$driver = $this->getFFMpegDriverMock();
$ffprobe = $this->getFFProbeMock();
new Audio('/no/file', $driver, $ffprobe);
}
public function testFiltersReturnsAudioFilters()
{
$driver = $this->getFFMpegDriverMock();

View file

@ -6,14 +6,6 @@ use FFMpeg\Media\Frame;
class FrameTest extends AbstractMediaTestCase
{
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testWithInvalidFile()
{
new Frame($this->getVideoMock('/No/file'), $this->getFFMpegDriverMock(), $this->getFFProbeMock(), $this->getTimeCodeMock());
}
public function testGetTimeCode()
{
$driver = $this->getFFMpegDriverMock();

View file

@ -9,17 +9,6 @@ use FFMpeg\Format\VideoInterface;
class VideoTest extends AbstractStreamableTestCase
{
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testWithInvalidFile()
{
$driver = $this->getFFMpegDriverMock();
$ffprobe = $this->getFFProbeMock();
new Video('/no/file', $driver, $ffprobe);
}
public function testFiltersReturnsVideoFilters()
{
$driver = $this->getFFMpegDriverMock();