-
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.
Merge pull request #51 from mhor/analysis-864y1W
Applied fixes from StyleCI
- Loading branch information
Showing
3 changed files
with
31 additions
and
33 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
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 |
---|---|---|
@@ -1,64 +1,64 @@ | ||
<?php | ||
|
||
use Mhor\MediaInfo\Container\MediaInfoContainer, | ||
Mhor\MediaInfo\Type\General, | ||
Mhor\MediaInfo\Type\Audio; | ||
use Mhor\MediaInfo\Container\MediaInfoContainer; | ||
use Mhor\MediaInfo\Type\Audio; | ||
use Mhor\MediaInfo\Type\General; | ||
|
||
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)); | ||
} | ||
} | ||
} |