Fix mocking of objects for newer phpunit version

This commit is contained in:
Alexander Schranz 2020-02-13 00:23:11 +01:00
commit 537f61095f
29 changed files with 87 additions and 84 deletions

View file

@ -29,7 +29,7 @@ class AudioTest extends AbstractStreamableTestCase
$audio = new Audio(__FILE__, $driver, $ffprobe);
$audio->setFiltersCollection($filters);
$filter = $this->getMock('FFMpeg\Filters\Audio\AudioFilterInterface');
$filter = $this->getMockBuilder('FFMpeg\Filters\Audio\AudioFilterInterface')->getMock();
$filters->expects($this->once())
->method('add')
@ -50,7 +50,7 @@ class AudioTest extends AbstractStreamableTestCase
$audio = new Audio(__FILE__, $driver, $ffprobe);
$audio->setFiltersCollection($filters);
$filter = $this->getMock('FFMpeg\Filters\Video\VideoFilterInterface');
$filter = $this->getMockBuilder('FFMpeg\Filters\Video\VideoFilterInterface')->getMock();
$filters->expects($this->never())
->method('add');
@ -65,7 +65,7 @@ class AudioTest extends AbstractStreamableTestCase
$ffprobe = $this->getFFProbeMock();
$outputPathfile = '/target/file';
$format = $this->getMock('FFMpeg\Format\AudioInterface');
$format = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$format->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array()));
@ -91,12 +91,12 @@ class AudioTest extends AbstractStreamableTestCase
$driver = $this->getFFMpegDriverMock();
$ffprobe = $this->getFFProbeMock();
$outputPathfile = '/target/file';
$format = $this->getMock('FFMpeg\Format\AudioInterface');
$format = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$format->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array()));
$configuration = $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface');
$configuration = $this->getMockBuilder('Alchemy\BinaryDriver\ConfigurationInterface')->getMock();
$driver->expects($this->any())
->method('getConfiguration')
@ -104,7 +104,7 @@ class AudioTest extends AbstractStreamableTestCase
$audio = new Audio(__FILE__, $driver, $ffprobe);
$filter = $this->getMock('FFMpeg\Filters\Audio\AudioFilterInterface');
$filter = $this->getMockBuilder('FFMpeg\Filters\Audio\AudioFilterInterface')->getMock();
$filter->expects($this->once())
->method('apply')
->with($audio, $format)
@ -138,7 +138,7 @@ class AudioTest extends AbstractStreamableTestCase
$driver = $this->getFFMpegDriverMock();
$ffprobe = $this->getFFProbeMock();
$configuration = $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface');
$configuration = $this->getMockBuilder('Alchemy\BinaryDriver\ConfigurationInterface')->getMock();
$driver->expects($this->any())
->method('getConfiguration')
@ -180,7 +180,7 @@ class AudioTest extends AbstractStreamableTestCase
public function provideSaveData()
{
$format = $this->getMock('FFMpeg\Format\AudioInterface');
$format = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$format->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array()));
@ -191,7 +191,7 @@ class AudioTest extends AbstractStreamableTestCase
->method('getAudioChannels')
->will($this->returnValue(5));
$audioFormat = $this->getMock('FFMpeg\Format\AudioInterface');
$audioFormat = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$audioFormat->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array()));
@ -205,7 +205,7 @@ class AudioTest extends AbstractStreamableTestCase
->method('getAudioCodec')
->will($this->returnValue('patati-patata-audio'));
$formatExtra = $this->getMock('FFMpeg\Format\AudioInterface');
$formatExtra = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$formatExtra->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array('extra', 'param')));
@ -216,7 +216,7 @@ class AudioTest extends AbstractStreamableTestCase
->method('getAudioChannels')
->will($this->returnValue(5));
$listeners = array($this->getMock('Alchemy\BinaryDriver\Listeners\ListenerInterface'));
$listeners = array($this->getMockBuilder('Alchemy\BinaryDriver\Listeners\ListenerInterface')->getMock());
$progressableFormat = $this->getMockBuilder('Tests\FFMpeg\Unit\Media\AudioProg')
->disableOriginalConstructor()->getMock();
@ -290,7 +290,7 @@ class AudioTest extends AbstractStreamableTestCase
$driver = $this->getFFMpegDriverMock();
$ffprobe = $this->getFFProbeMock();
$configuration = $this->getMock('Alchemy\BinaryDriver\ConfigurationInterface');
$configuration = $this->getMockBuilder('Alchemy\BinaryDriver\ConfigurationInterface')->getMock();
$driver->expects($this->any())
->method('getConfiguration')
@ -317,7 +317,7 @@ class AudioTest extends AbstractStreamableTestCase
$outputPathfile = '/target/file';
$format = $this->getMock('FFMpeg\Format\AudioInterface');
$format = $this->getMockBuilder('FFMpeg\Format\AudioInterface')->getMock();
$format->expects($this->any())
->method('getExtraParams')
->will($this->returnValue(array('param')));