Exemplo n.º 1
0
 public function testWrite()
 {
     $this->eyed3Wrapper->setBinPath(Helper::getEyed3Path());
     $writeData = ['artist' => 'Artist', 'title' => 'Title', 'album' => 'l\'album', 'genre' => 'Dance Hall', 'year' => 2011, 'comm' => 'Test comment', 'bpm' => '122'];
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $metaDataFile->setArtist($writeData['artist']);
     $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->eyed3Wrapper->write($metaDataFile));
     $metaDataFile = new Id3Metadata(Helper::getSampleMp3File());
     $this->assertTrue($this->eyed3Wrapper->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());
 }