| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
require_once dirname(dirname(__FILE__)) . '/XML_Feed_Parser_TestCase.php';
|
|
|
4 |
|
|
|
5 |
class namespace_TestCase extends XML_Feed_Parser_Converted_TestCase {
|
|
|
6 |
|
|
|
7 |
function test_rss1_0withModules_1() {
|
|
|
8 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModules.xml');
|
|
|
9 |
|
|
|
10 |
$feed = new XML_Feed_Parser($content);
|
|
|
11 |
|
|
|
12 |
$this->assertEquals('Test Item - RSS 1.0', $feed->getEntryByOffset(0)->title);
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
function test_rss1_0withModulesNoDefNS_1() {
|
|
|
16 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModulesNoDefNS.xml');
|
|
|
17 |
|
|
|
18 |
$feed = new XML_Feed_Parser($content);
|
|
|
19 |
|
|
|
20 |
$this->assertEquals('Test Item - RSS 1.0 no Default NS', $feed->getEntryByOffset(0)->title);
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
function test_rss1_0withModulesNoDefNSLocalNameClash_1() {
|
|
|
24 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModulesNoDefNSLocalNameClash.xml');
|
|
|
25 |
|
|
|
26 |
$feed = new XML_Feed_Parser($content);
|
|
|
27 |
|
|
|
28 |
$this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
function test_rss2_0noNSwithModules_1() {
|
|
|
32 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0noNSwithModules.xml');
|
|
|
33 |
|
|
|
34 |
$feed = new XML_Feed_Parser($content);
|
|
|
35 |
|
|
|
36 |
$this->assertEquals('Test Item - RSS 2.0 no NS', $feed->getEntryByOffset(0)->title);
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
function test_rss2_0noNSwithModulesLocalNameClash_1() {
|
|
|
40 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0noNSwithModulesLocalNameClash.xml');
|
|
|
41 |
|
|
|
42 |
$feed = new XML_Feed_Parser($content);
|
|
|
43 |
|
|
|
44 |
$this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
function test_rss2_0NSwithModules_1() {
|
|
|
48 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModules.xml');
|
|
|
49 |
|
|
|
50 |
$feed = new XML_Feed_Parser($content);
|
|
|
51 |
|
|
|
52 |
$this->assertEquals('Test Item - RSS2.0 w/ NS', $feed->getEntryByOffset(0)->title);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
function test_rss2_0NSwithModulesNoDefNS_1() {
|
|
|
56 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModulesNoDefNS.xml');
|
|
|
57 |
|
|
|
58 |
$feed = new XML_Feed_Parser($content);
|
|
|
59 |
|
|
|
60 |
$this->assertEquals('Test Item - - RSS2.0 w/ NS no default NS', $feed->getEntryByOffset(0)->title);
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
function test_rss2_0NSwithModulesNoDefNSLocalNameClash_1() {
|
|
|
64 |
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModulesNoDefNSLocalNameClash.xml');
|
|
|
65 |
|
|
|
66 |
$feed = new XML_Feed_Parser($content);
|
|
|
67 |
|
|
|
68 |
$this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
|
|
|
69 |
}
|
|
|
70 |
}
|
|
|
71 |
?>
|