File_Bittorrent
[ class tree: File_Bittorrent ] [ index: File_Bittorrent ] [ all elements ]

Source for file Bug8085.php

Documentation is available at Bug8085.php

  1. <?php
  2.  
  3. // +----------------------------------------------------------------------+
  4. // | Decode and Encode data in Bittorrent format                          |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (C) 2004-2005 Markus Tacker <m@tacker.org>                 |
  7. // +----------------------------------------------------------------------+
  8. // | This library is free software; you can redistribute it and/or        |
  9. // | modify it under the terms of the GNU Lesser General Public           |
  10. // | License as published by the Free Software Foundation; either         |
  11. // | version 2.1 of the License, or (at your option) any later version.   |
  12. // |                                                                      |
  13. // | This library is distributed in the hope that it will be useful,      |
  14. // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
  15. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
  16. // | Lesser General Public License for more details.                      |
  17. // |                                                                      |
  18. // | You should have received a copy of the GNU Lesser General Public     |
  19. // | License along with this library; if not, write to the                |
  20. // | Free Software Foundation, Inc.                                       |
  21. // | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA               |
  22. // +----------------------------------------------------------------------+
  23.  
  24.     
  25.     /**
  26.     * Test for Bug #8085
  27.     *
  28.     * @link http://pear.php.net/bugs/bug.php?id=8085
  29.     * @package File_Bittorrent
  30.     * @subpackage Test
  31.     * @category File
  32.     * @author Markus Tacker <m@tacker.org>
  33.     * @version $Id: Bug8085.php 72 2007-03-13 14:53:28Z m $
  34.     */
  35.  
  36.     require_once 'PHPUnit/Framework/TestCase.php';
  37.     require_once 'File/Bittorrent/Decode.php';
  38.  
  39.     /**
  40.     * Test for Bug #8085
  41.     *
  42.     * @link http://pear.php.net/bugs/bug.php?id=8085
  43.     * @package File_Bittorrent
  44.     * @subpackage Test
  45.     * @category File
  46.     * @author Markus Tacker <m@tacker.org>
  47.     * @version $Id: Bug8085.php 72 2007-03-13 14:53:28Z m $
  48.     */
  49.     class Tests_Bug8085 extends PHPUnit_Framework_TestCase
  50.     {
  51.         public static $torrent './bugs/bug-8085/multiple_tracker.torrent';
  52.  
  53.         public function testAnnounceList()
  54.         {
  55.             $Decode = new File_Bittorrent_Decode;
  56.             $info $Decode->decodeFile(self::$torrent);
  57.             $expected = array (
  58.                 array (
  59.                     'http://tracker.gotwoot.net:6968/announce',
  60.                 ),
  61.                 array (
  62.                     'http://www.point-blank.cc:6969/announce',
  63.                     'http://www.point-blank.cc:7000/announce',
  64.                     'http://www.point-blank.cc:7001/announce',
  65.                 ),
  66.             );
  67.             $this->assertEquals($expected$info['announce_list']);
  68.             unset($Decode);
  69.         }
  70.     }
  71.  
  72. ?>

Documentation generated on Tue, 13 Mar 2007 10:00:09 -0500 by phpDocumentor 1.3.0. PEAR Logo Copyright © PHP Group 2004.