public function test_main_details() { $this->assertEquals('http://tracker.u2start.com/132/ffffffffffffffffffffffffffffffffffffffff/announce/', $this->torrent->getAnnounce()); $this->assertEquals(array(array("udp://tracker.u2start.com:8080/132/ffffffffffffffffffffffffffffffffffffffff/announce/"), array("http://tracker.u2start.com/132/ffffffffffffffffffffffffffffffffffffffff/announce/")), $this->torrent->getAnnounceList()); $this->assertEquals(12262452774, $this->torrent->getSize()); $this->assertEquals("Powered By:\nu2start.com - Share Your Passion", $this->torrent->getComment()); $this->assertEquals("618b40bddf786d3af341f2bb00e441b355ecc953", $this->torrent->getInfoHash(false)); $this->assertEquals(hex2bin("618b40bddf786d3af341f2bb00e441b355ecc953"), $this->torrent->getInfoHash()); }
public function test_main_details() { $this->torrent = Torrent::fromFile(__DIR__ . '/ubuntu-13.10-desktop-amd64.iso.torrent'); $this->assertEquals('http://torrent.ubuntu.com:6969/announce', $this->torrent->getAnnounce()); $this->assertEquals(array(array('http://torrent.ubuntu.com:6969/announce'), array('http://ipv6.torrent.ubuntu.com:6969/announce')), $this->torrent->getAnnounceList()); $this->assertEquals(925892608, $this->torrent->getSize()); $this->assertEquals("Ubuntu CD releases.ubuntu.com", $this->torrent->getComment()); $this->assertEquals("e3811b9539cacff680e418124272177c47477157", $this->torrent->getInfoHash(false)); $this->assertEquals(hex2bin("e3811b9539cacff680e418124272177c47477157"), $this->torrent->getInfoHash()); }