Fix PhpUnit tests for newer php version

This commit is contained in:
Alexander Schranz 2020-02-13 00:39:31 +01:00
commit 14dc6a8b1b
21 changed files with 48 additions and 40 deletions

View file

@ -9,7 +9,11 @@ abstract class AudioTestCase extends TestCase
{
public function testExtraParams()
{
foreach ($this->getFormat()->getExtraParams() as $param) {
$extraParams = $this->getFormat()->getExtraParams();
$this->assertIsArray($extraParams);
foreach ($extraParams as $param) {
$this->assertScalar($param);
}
}
@ -31,10 +35,10 @@ abstract class AudioTestCase extends TestCase
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testSetInvalidAudioCodec()
{
$this->expectException('\FFMpeg\Exception\InvalidArgumentException');
$this->getFormat()->setAudioCodec('invalid-random-audio-codec');
}
@ -45,7 +49,7 @@ abstract class AudioTestCase extends TestCase
public function testGetAudioKiloBitrate()
{
$this->assertInternalType('integer', $this->getFormat()->getAudioKiloBitrate());
$this->assertIsInt($this->getFormat()->getAudioKiloBitrate());
}
public function testSetAudioKiloBitrate()
@ -56,24 +60,24 @@ abstract class AudioTestCase extends TestCase
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testSetInvalidKiloBitrate()
{
$this->expectException('\FFMpeg\Exception\InvalidArgumentException');
$this->getFormat()->setAudioKiloBitrate(0);
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testSetNegativeKiloBitrate()
{
$this->expectException('\FFMpeg\Exception\InvalidArgumentException');
$this->getFormat()->setAudioKiloBitrate(-10);
}
public function testGetAudioChannels()
{
$this->assertInternalType('null', $this->getFormat()->getAudioChannels());
$this->assertNull($this->getFormat()->getAudioChannels());
}
public function testSetAudioChannels()
@ -84,18 +88,18 @@ abstract class AudioTestCase extends TestCase
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testSetInvalidChannels()
{
$this->expectException('\FFMpeg\Exception\InvalidArgumentException');
$this->getFormat()->setAudioChannels(0);
}
/**
* @expectedException FFMpeg\Exception\InvalidArgumentException
*/
public function testSetNegativeChannels()
{
$this->expectException('\FFMpeg\Exception\InvalidArgumentException');
$this->getFormat()->setAudioChannels(-10);
}