root/trunk/Tests/Bug8085.php

Revision 72, 2.8 KB (checked in by m, 22 months ago)

Switched Tests to PHPUnit3

  • Property svn:keywords set to Id Rev
Line 
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    * Test for Bug #8085
26    *
27    * @link http://pear.php.net/bugs/bug.php?id=8085
28    * @package File_Bittorrent
29    * @subpackage Test
30    * @category File
31    * @author Markus Tacker <m@tacker.org>
32    * @version $Id$
33    */
34
35    require_once 'PHPUnit/Framework/TestCase.php';
36    require_once 'File/Bittorrent/Decode.php';
37
38    /**
39    * Test for Bug #8085
40    *
41    * @link http://pear.php.net/bugs/bug.php?id=8085
42    * @package File_Bittorrent
43    * @subpackage Test
44    * @category File
45    * @author Markus Tacker <m@tacker.org>
46    * @version $Id$
47    */
48    class Tests_Bug8085 extends PHPUnit_Framework_TestCase
49    {
50        public static $torrent = './bugs/bug-8085/multiple_tracker.torrent';
51
52        public function testAnnounceList()
53        {
54            $Decode = new File_Bittorrent_Decode;
55            $info = $Decode->decodeFile(self::$torrent);
56            $expected = array (
57                array (
58                    'http://tracker.gotwoot.net:6968/announce',
59                ),
60                array (
61                    'http://www.point-blank.cc:6969/announce',
62                    'http://www.point-blank.cc:7000/announce',
63                    'http://www.point-blank.cc:7001/announce',
64                ),
65            );
66            $this->assertEquals($expected, $info['announce_list']);
67            unset($Decode);
68        }
69    }
70
71?>
Note: See TracBrowser for help on using the browser.