Support for decoding and encoding frames with unsynchronisation schema (ID3v2.4 only)

git-svn-id: http://php-reader.googlecode.com/svn/trunk@107 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
svollbehr
2008-08-03 19:09:16 +00:00
parent 809bf58885
commit 741de5a2ab
10 changed files with 221 additions and 93 deletions

View File

@@ -121,4 +121,19 @@ final class TestID3v2 extends PHPUnit_Framework_TestCase
$this->assertEquals("13/13", $id3->trck->text);
$this->assertEquals("Trance", $id3->tcon->text);
}
function testUnsynchronisation()
{
$id3 = new ID3v2("id3v2.tag");
$id3->tit2->text = "\xff\xf0";
$id3->tcon->text = "\xff\xe0\xf0";
$id3->write();
$this->assertEquals
("TIT2\0\0\0\x08\0\x03\0\0\0\x03\x03\xff\x00\xf0", "" . $id3->tit2);
$id3 = new ID3v2("id3v2.tag");
$this->assertEquals("\xff\xf0", $id3->tit2->text);
$this->assertEquals("\xff\xe0\xf0", $id3->tcon->text);
}
}