Changeset 84 for trunk/Tests
- Timestamp:
- 12.06.2008 11:52:16 (7 months ago)
- Files:
-
- 1 modified
-
trunk/Tests/FileBittorrent.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tests/FileBittorrent.php
r76 r84 55 55 $File_Bittorrent_Decode->decodeFile(self::$torrent); 56 56 exec('torrentinfo-console ' . escapeshellarg(self::$torrent), $bt); 57 $this->assertEquals($File_Bittorrent_Decode-> info_hash, substr($bt[3], strpos($bt[3], ':') + 2));57 $this->assertEquals($File_Bittorrent_Decode->getInfoHash(), substr($bt[3], strpos($bt[3], ':') + 2)); 58 58 } 59 59 … … 114 114 ini_set('mbstring.internal_encoding','ASCII'); 115 115 foreach($test_data as $ti => $to) { 116 $this->assertEquals($to, $File_Bittorrent_Decode->decode($ti)); 116 if ($to === false) { 117 try { 118 $File_Bittorrent_Decode->decode($ti); 119 $this->fail('File_Bittorrent successfully decoded invalid data.'); 120 } catch (File_Bittorrent_Exception $E) { 121 if ($E->getCode() != File_Bittorrent_Exception::decode) throw $E; 122 } 123 } else { 124 $this->assertEquals($to, $File_Bittorrent_Decode->decode($ti)); 125 } 117 126 } 118 127 }