-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/mediainfocontainer dump (#50)
* added globally support to dump the "MediaInfoContainer" into json and array * readme.md updated * composer.json > PHP Required version updated * added .gitignore * composer.lock removed * composer.phar removed * vendor directory removed * CI fix * readme.md restores * Added unit tests * Added unit test without require mediainfo * Removed 5.3.x test for CI
- Loading branch information
1 parent
7edba90
commit 54f17be
Showing
8 changed files
with
127 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
vendor/ | ||
composer.phar | ||
composer.lock | ||
MediaInfo.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ language: php | |
sudo: false | ||
|
||
php: | ||
- 5.3.3 | ||
- 5.3 | ||
- 5.4 | ||
- 5.5.9 | ||
- 5.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
use Mhor\MediaInfo\Container\MediaInfoContainer, | ||
Mhor\MediaInfo\Type\General, | ||
Mhor\MediaInfo\Type\Audio; | ||
|
||
class MediaInfoContainerTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
private function createContainer() | ||
{ | ||
$mediaInfoContainer = new MediaInfoContainer(); | ||
|
||
$general = new General(); | ||
|
||
$general->set('Format', 'MPEG Audio'); | ||
$general->set('Duration', '1mn 20s'); | ||
|
||
$audio = new Audio(); | ||
|
||
$audio->set('Format', 'MPEG Audio'); | ||
$audio->set('Bit rate', '56.0 Kbps'); | ||
|
||
$mediaInfoContainer->add($audio); | ||
$mediaInfoContainer->add($general); | ||
|
||
return $mediaInfoContainer; | ||
} | ||
|
||
public function testToJson() | ||
{ | ||
$mediaInfoContainer = $this->createContainer(); | ||
|
||
$data = json_encode($mediaInfoContainer); | ||
|
||
$this->assertRegExp('/^\{.+\}$/', $data); | ||
} | ||
|
||
public function testToJsonType() | ||
{ | ||
$mediaInfoContainer = $this->createContainer(); | ||
|
||
$data = json_encode($mediaInfoContainer->getGeneral()); | ||
|
||
$this->assertRegExp('/^\{.+\}$/', $data); | ||
} | ||
|
||
public function testToArray() | ||
{ | ||
$mediaInfoContainer = $this->createContainer(); | ||
|
||
$array = $mediaInfoContainer->__toArray(); | ||
|
||
$this->assertArrayHasKey('version', $array); | ||
} | ||
|
||
public function testToArrayType() | ||
{ | ||
$mediaInfoContainer = $this->createContainer(); | ||
|
||
$array = $mediaInfoContainer->getGeneral()->__toArray(); | ||
|
||
$this->assertTrue(is_array($array)); | ||
} | ||
} |
Binary file not shown.