Location: PHPKode > scripts > PHP MIDI Parser > midiparser-1.0/tests/Midi/TrackHeaderTest.php
<?php
	
	namespace Midi\Tests;

	class TrackHeaderTest extends \PHPUnit_Framework_TestCase {
		
		private $obj;
		
		public function setUp() {
			$this->obj = new \Midi\TrackHeader(0x974A8);
		}
		
		public function tearDown() {
			$this->obj = null;
		}
		
		public function testToString() {
			$this->assertEquals('Track (619688 bytes)', $this->obj->__toString());
		}
		
		public function testToBinary() {
			$binary  = pack('C4', 0x4D, 0x54, 0x72, 0x6B);
			$binary .= pack('C4', 0x00, 0x09, 0x74, 0xA8);
			$this->assertEquals($binary, $this->obj->toBinary());
		}
		
		public function testGetData() {
			$this->assertEquals(array(0x974A8), $this->obj->getData());
		}
		
		public function testGetLength() {
			$this->assertEquals(8, $this->obj->getLength());
		}
		
	}

?>
Return current item: PHP MIDI Parser