コード例 #1
0
ファイル: TorrentTest.php プロジェクト: devristo/torrent
 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());
 }
コード例 #2
0
 public function setUp()
 {
     $this->torrent = Torrent::fromFile('multifile.torrent');
 }