| 1 |
lars |
1 |
<?php
|
|
|
2 |
// +------------------------------------------------------------------------+
|
|
|
3 |
// | PEAR :: XML_RSS |
|
|
|
4 |
// +------------------------------------------------------------------------+
|
|
|
5 |
// | Copyright (c) 2004 Martin Jansen |
|
|
|
6 |
// +------------------------------------------------------------------------+
|
|
|
7 |
// | This source file is subject to version 3.00 of the PHP License, |
|
|
|
8 |
// | that is available at http://www.php.net/license/3_0.txt. |
|
|
|
9 |
// | If you did not receive a copy of the PHP license and are unable to |
|
|
|
10 |
// | obtain it through the world-wide-web, please send a note to |
|
|
|
11 |
// | license@php.net so we can mail you a copy immediately. |
|
|
|
12 |
// +------------------------------------------------------------------------+
|
|
|
13 |
//
|
|
|
14 |
// $Id: XML_RSS_Infrastructure_Test.php 295062 2010-02-14 14:43:35Z cweiske $
|
|
|
15 |
//
|
|
|
16 |
|
|
|
17 |
if (!defined('PHPUnit_MAIN_METHOD')) {
|
|
|
18 |
define('PHPUnit_MAIN_METHOD', 'XML_RSS_Infrastructure_Test::main');
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
require_once "PHPUnit/Framework.php";
|
|
|
22 |
require_once "XML/RSS.php";
|
|
|
23 |
|
|
|
24 |
/**
|
|
|
25 |
* Unit test suite for the XML_RSS package
|
|
|
26 |
*
|
|
|
27 |
* This test suite does not provide tests that make sure that XML_RSS
|
|
|
28 |
* parses XML files correctly. It only ensures that the "infrastructure"
|
|
|
29 |
* works fine.
|
|
|
30 |
*
|
|
|
31 |
* @author Martin Jansen <mj@php.net>
|
|
|
32 |
* @extends PHPUnit_TestCase
|
|
|
33 |
* @version $Id: XML_RSS_Infrastructure_Test.php 295062 2010-02-14 14:43:35Z cweiske $
|
|
|
34 |
*/
|
|
|
35 |
class XML_RSS_Infrastructure_Test extends PHPUnit_Framework_TestCase
|
|
|
36 |
{
|
|
|
37 |
public static function main()
|
|
|
38 |
{
|
|
|
39 |
require_once 'PHPUnit/TextUI/TestRunner.php';
|
|
|
40 |
PHPUnit_TextUI_TestRunner::run(
|
|
|
41 |
new PHPUnit_Framework_TestSuite('XML_RSS_Infrastructure_Test')
|
|
|
42 |
);
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
/**
|
|
|
46 |
* Test case for making sure that XML_RSS extends from XML_Parser
|
|
|
47 |
*/
|
|
|
48 |
function testIsXML_Parser() {
|
|
|
49 |
$rss =& new XML_RSS();
|
|
|
50 |
$this->assertTrue(is_a($rss, "XML_Parser"));
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
/**
|
|
|
54 |
* Test case for bug report #2310
|
|
|
55 |
*
|
|
|
56 |
* @link http://pear.php.net/bugs/2310/
|
|
|
57 |
*/
|
|
|
58 |
function testBug2310() {
|
|
|
59 |
$rss =& new XML_RSS("", null, "utf-8");
|
|
|
60 |
$this->assertEquals($rss->tgtenc, "utf-8");
|
|
|
61 |
|
|
|
62 |
$rss =& new XML_RSS("", "utf-8", "iso-8859-1");
|
|
|
63 |
$this->assertEquals($rss->srcenc, "utf-8");
|
|
|
64 |
$this->assertEquals($rss->tgtenc, "iso-8859-1");
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
if (PHPUnit_MAIN_METHOD == 'XML_RSS_Infrastructure_Test::main') {
|
|
|
69 |
XML_RSS_Infrastructure_Test::main();
|
|
|
70 |
}
|
|
|
71 |
?>
|