cdf.php
4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
require_once 'XML_Feed_Parser_TestCase.php';
class cdf_TestCase extends XML_Feed_Parser_Converted_TestCase {
function test_channel_abstract_map_description_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/channel_abstract_map_description.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example description', $feed->description);
}
function test_channel_abstract_map_tagline_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/channel_abstract_map_tagline.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example description', $feed->tagline);
}
function test_channel_href_map_link_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/channel_href_map_link.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('http://www.example.org/', $feed->link);
}
function test_channel_href_map_links_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/channel_href_map_links.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('http://www.example.org/', $feed->links(0, 'href'));
}
function test_channel_title_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/channel_title.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example feed', $feed->title);
}
function test_item_abstract_map_description_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/item_abstract_map_description.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example description', $feed->getEntryByOffset(0)->description);
}
function test_item_abstract_map_summary_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/item_abstract_map_summary.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example description', $feed->getEntryByOffset(0)->summary);
}
function test_item_href_map_link_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/item_href_map_link.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('http://www.example.org/', $feed->getEntryByOffset(0)->link);
}
function test_item_href_map_links_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/item_href_map_links.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('http://www.example.org/', $feed->getEntryByOffset(0)->links(0, 'href'));
}
function test_item_title_1 () {
$content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/cdf/item_title.xml');
try {
$feed = new XML_Feed_Parser($content);
} catch (XML_Feed_Parser_Exception $e) {
$this->assertTrue(false);
return;
}
$this->assertEquals('Example item', $feed->getEntryByOffset(0)->title);
}
}
$suite = new PHPUnit_TestSuite('cdf_TestCase');
$result = PHPUnit::run($suite, '123');
echo $result->toString();
?>