Beispiel #1
0
 public static function setUpBeforeClass()
 {
     self::$id3meta = new \Sapar\Id3\Metadata\Id3Metadata(Helper::getSampleMp3File());
     self::$eyed3 = new \Sapar\Id3\Wrapper\BinWrapper\Eyed3Wrapper();
     self::$eyed3->setBinPath(Helper::getEyed3Path());
     self::$mediainfo = new \Sapar\Id3\Wrapper\BinWrapper\MediainfoWrapper();
     self::$mediainfo->setBinPath(Helper::getMediainfoPath());
 }
 public function testWrite()
 {
     $this->id3v2Wrapper->setBinPath(Helper::getId3v2Path());
     $writeData = ['title' => 'Title', 'album' => 'l\'album', 'genre' => 'Dance Hall', 'year' => 2011, 'comm' => 'Test comment', 'bpm' => '122'];
     Helper::backupFile(Helper::getSampleMp3File());
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $metaDataFile->setAlbum($writeData['album']);
     $metaDataFile->setTitle($writeData['title']);
     $metaDataFile->setGenre($writeData['genre']);
     $metaDataFile->setYear($writeData['year']);
     $metaDataFile->setComment($writeData['comm']);
     $metaDataFile->setBpm($writeData['bpm']);
     $this->assertTrue($this->id3v2Wrapper->write($metaDataFile));
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $this->assertTrue($this->id3v2Wrapper->read($metaDataFile));
     $this->assertEquals($writeData['album'], $metaDataFile->getAlbum());
     $this->assertEquals($writeData['title'], $metaDataFile->getTitle());
     $this->assertEquals($writeData['genre'], $metaDataFile->getGenre());
     $this->assertEquals($writeData['comm'], $metaDataFile->getComment());
     $this->assertEquals($writeData['bpm'], $metaDataFile->getBpm());
     Helper::restoreFile(Helper::getSampleMp3File());
 }
 /**
  * @return Id3MetadataInterface
  */
 private function getId3MetadataInstance()
 {
     return new Id3Metadata(Helper::getSampleMp3File());
 }
 public function testGetVersion()
 {
     $this->eyed3Wrapper->setBinPath(Helper::getEyed3Path());
     $this->assertContains('eyeD3', $this->eyed3Wrapper->getVersion());
 }
 public function testWrite()
 {
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $this->assertFalse($this->mediaInfoWrapper->supportWrite($metaDataFile));
     $this->mediaInfoWrapper->write($metaDataFile);
 }