source: branches/beta/html/test/adachi/PLLagger/Lib/XML/Feed/tests/rss092Values.php @ 15120

Revision 15120, 3.9 KB checked in by adati, 17 years ago (diff)

1.4.2betaのマージ

Line 
1<?php
2
3require_once 'XML_Feed_Parser_TestCase.php';
4
5class XML_Feed_Parser_RSS092_valueValidity_TestCase extends XML_Feed_Parser_TestCase
6{
7    function __construct($name)
8    {
9        $this->PHPUnit_TestCase($name);
10        $sample_dir = XML_Feed_Parser_TestCase::getSampleDir();
11        $this->file = file_get_contents($sample_dir . DIRECTORY_SEPARATOR . "rss092-sample.xml");
12        $this->feed = new XML_Feed_Parser($this->file, false, true);
13        $this->entry = $this->feed->getEntryByOffset(0);
14    }
15
16    function test_feedNumberItems()
17    {
18        $value = 22;
19        $this->assertEquals($value, $this->feed->numberEntries);
20    }
21
22    function test_feedTitle()
23    {
24        $value = "Dave Winer: Grateful Dead";
25        $this->assertEquals($value, $this->feed->title);
26    }
27   
28    function test_feedLink()
29    {
30        $value = "http://www.scripting.com/blog/categories/gratefulDead.html";
31        $this->assertEquals($value, $this->feed->link);
32    }
33
34    function test_feedDescription()
35    {
36        $value = "A high-fidelity Grateful Dead song every day. This is where we're experimenting with enclosures on RSS news items that download when you're not using your computer. If it works (it will) it will be the end of the Click-And-Wait multimedia experience on the Internet. ";
37        $this->assertEquals($value, $this->feed->description);
38    }
39   
40    function test_feedSubtitleEquivalence()
41    {
42        $value = "A high-fidelity Grateful Dead song every day. This is where we're experimenting with enclosures on RSS news items that download when you're not using your computer. If it works (it will) it will be the end of the Click-And-Wait multimedia experience on the Internet. ";
43        $this->assertEquals($value, $this->feed->subtitle);
44    }
45   
46    function test_feedLastBuildDate()
47    {
48        $value = strtotime("Fri, 13 Apr 2001 19:23:02 GMT");
49        $this->assertEquals($value, $this->feed->lastBuildDate);
50    }
51   
52    function test_feedUpdatedEquivalence()
53    {
54        $value = strtotime("Fri, 13 Apr 2001 19:23:02 GMT");
55        $this->assertEquals($value, $this->feed->updated);
56    }
57   
58    function test_feedDocs()
59    {
60        $value = "http://backend.userland.com/rss092";
61        $this->assertEquals($value, $this->feed->docs);
62    }
63   
64    function test_feedManagingEditor()
65    {
66        $value = "dave@userland.com (Dave Winer)";
67        $this->assertEquals($value, $this->feed->managingEditor);
68    }
69   
70    function test_feedAuthorEquivalence()
71    {
72        $value = "dave@userland.com (Dave Winer)";
73        $this->assertEquals($value, $this->feed->author);
74    }
75   
76    function test_feedWebmaster()
77    {
78        $value = "dave@userland.com (Dave Winer)";
79        $this->assertEquals($value, $this->feed->webMaster);
80    }
81   
82    function test_entryDescription()
83    {
84        $value = "It's been a few days since I added a song to the Grateful Dead channel. Now that there are all these new Radio users, many of whom are tuned into this channel (it's #16 on the hotlist of upstreaming Radio users, there's no way of knowing how many non-upstreaming users are subscribing, have to do something about this..). Anyway, tonight's song is a live version of Weather Report Suite from Dick's Picks Volume 7. It's wistful music. Of course a beautiful song, oft-quoted here on Scripting News. <i>A little change, the wind and rain.</i>";
85        $this->assertEquals($value, trim($this->entry->description));
86    }
87   
88    function test_entryEnclosure()
89    {
90        $value = array(
91            'url' =>  'http://www.scripting.com/mp3s/weatherReportDicksPicsVol7.mp3',
92            'length' => '6182912',
93            'type' => 'audio/mpeg');
94        $this->assertEquals($value, $this->entry->enclosure);
95    }
96}
97
98$suite = new PHPUnit_TestSuite;
99$suite->addTestSuite("XML_Feed_Parser_RSS092_valueValidity_TestCase");
100$result = PHPUnit::run($suite, "123");
101echo $result->toString();
102
103?>
Note: See TracBrowser for help on using the repository browser.