Changeset 84 for trunk/Tests

Show
Ignore:
Timestamp:
12.06.2008 11:52:16 (7 months ago)
Author:
m
Message:

Tagging 2.2.0 release

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Tests/FileBittorrent.php

    r76 r84  
    5555            $File_Bittorrent_Decode->decodeFile(self::$torrent); 
    5656            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)); 
    5858        } 
    5959 
     
    114114            ini_set('mbstring.internal_encoding','ASCII'); 
    115115            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                } 
    117126            } 
    118127        }