public function testOpenTorrentFile()
 {
     $file = __DIR__ . '/assets/test.torrent';
     $torrent = file_get_contents($file);
     $dictionary = Bencode::dictionaryFactory(function () use($torrent) {
         return $torrent;
     }, true);
     $this->assertEquals($torrent, $dictionary->encode());
 }
Example #2
0
 public function testDictionaryEncodedFactory()
 {
     $dictionary = Bencode::dictionaryFactory('d3:key5:valuee', true);
     $this->assertEquals('value', $dictionary->write()['key']);
 }