Add metadata to audio files | completed tests
This commit is contained in:
parent
8cfb17682f
commit
89098b24a2
1 changed files with 18 additions and 0 deletions
|
|
@ -25,6 +25,24 @@ class AudioMetadataTest extends TestCase
|
|||
$this->assertEquals(array(0 => "-metadata", 1 => "title=Hello World"), $capturedFilter->apply($audio, $format));
|
||||
}
|
||||
|
||||
public function testAddArtwork()
|
||||
{
|
||||
$capturedFilter = null;
|
||||
|
||||
$audio = $this->getAudioMock();
|
||||
$audio->expects($this->once())
|
||||
->method('addFilter')
|
||||
->with($this->isInstanceOf('FFMpeg\Filters\Audio\AddMetadataFilter'))
|
||||
->will($this->returnCallback(function ($filter) use (&$capturedFilter) {
|
||||
$capturedFilter = $filter;
|
||||
}));
|
||||
$format = $this->getMock('FFMpeg\Format\AudioInterface');
|
||||
|
||||
$filters = new AudioFilters($audio);
|
||||
$filters->addMetadata(array('genre' => 'Some Genre', 'artwork' => "/path/to/file.jpg"));
|
||||
$this->assertEquals(array(0 => "-i", 1 => "/path/to/file.jpg", 2 => "-map", 3 => "0", 4 => "-map", 5 => "1", 6 => "-metadata", 7 => "genre=Some Genre"), $capturedFilter->apply($audio, $format));
|
||||
}
|
||||
|
||||
public function testRemoveMetadata()
|
||||
{
|
||||
$capturedFilter = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue