* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class RssTest extends TestCase { public function testModel() { $category = new Category(); $category->setText('Newspapers'); $enclosure = new Enclosure(); $enclosure->setUrl('http://www.scripting.com/mp3s/weatherReportSuite.mp3'); $enclosure->setLength(12216320); $enclosure->setType('audio/mpeg'); $source = new Source(); $source->setText('Tomalak\'s Realm'); $source->setUrl('http://www.tomalak.org/links2.xml'); $item = new Item(); $item->setTitle('Star City'); $item->setLink('http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp'); $item->setDescription('How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia\'s Star City.'); $item->setAuthor('foobar'); $item->setCategory([$category]); $item->setComments('http://localhost.com#comments'); $item->setEnclosure($enclosure); $item->setGuid('http://liftoff.msfc.nasa.gov/2003/06/03.html#item573'); $item->setPubDate(new \DateTime('Tue, 03 Jun 2003 09:39:21 GMT')); $item->setSource($source); $cloud = new Cloud(); $cloud->setDomain('rpc.sys.com'); $cloud->setPort(80); $cloud->setPath('/RPC2'); $cloud->setRegisterProcedure('pingMe'); $cloud->setProtocol('soap'); $rss = new Rss(); $rss->setTitle('Liftoff News'); $rss->setLink('http://liftoff.msfc.nasa.gov/'); $rss->setDescription('Liftoff to Space Exploration.'); $rss->setLanguage('en-us'); $rss->setCopyright('2014 foobar'); $rss->setManagingEditor('editor@example.com'); $rss->setWebMaster('webmaster@example.com'); $rss->setGenerator('Weblog Editor 2.0'); $rss->setDocs('http://blogs.law.harvard.edu/tech/rss'); $rss->setTtl(60); $rss->setImage('http://localhost.com/image.png'); $rss->setRating('en'); $rss->setSkipHours(20); $rss->setSkipDays('Tuesday'); $rss->setCategory([$category]); $rss->setPubDate(new \DateTime('Tue, 10 Jun 2003 04:00:00 GMT')); $rss->setLastBuildDate(new \DateTime('Tue, 10 Jun 2003 09:41:01 GMT')); $rss->setCloud($cloud); $rss->setItem([$item]); $dumper = new Dumper(); $actual = json_encode($dumper->dump($rss), JSON_PRETTY_PRINT); $expect = file_get_contents(__DIR__ . '/resource/rss.json'); $this->assertJsonStringEqualsJsonString($expect, $actual, $actual); } } __halt_compiler();----SIGNATURE:----Yl4mmqxUazJUdWIRzF8jT3Ei+RLgEGCYXaB3ZdFLOXbRy37Z9QnL+VqNBN4mrgqj0DHgJDkTw+66etxUYSrQsdlN1jY5xPMbkVW5Ivn7sKXbcbf0Qn2L3OJhH3RLQEH2a18MZvFsr+8lgNN/ZCbmw6bkGRdoErtfdyBfDO24NtiSGl2b+EqV+cOXC575lH2OLqVWc5gk/SEirZw6zdTnhMwFXP9taK1MqMaxu4jzMLuAY/6thSFkoHB8nSH+PpKBbuI/rQuVWR2TC/B1DcJCds/tym0u0P2K0SCMKkjkdzPFOokoU8CzX4/pbrCtazcL/2LH3fbWYgUpef+WXH8/LF28d6SPvuvgefPrxO0LLGFyqBagVDomdqpfDtO77x5LyqWN/PCs3nKxp0kyl6R1VJbbkKVz/WkcoMQeIlTFiUH4CxKPgfk9Soj0V5ah67cKMPYg8k1ZUWPFVJnpd1bPGwPhuOhjHsV2+MC+xk72+Zy1ADw3eK/6K6xrcWFL06OOel6avsQ/WxQB1kHvOtn814w1647hKmNox5FcECuyKiwNe/FJjOoxAoFPwH5NqYBfRZRpmwagl/oAtVhuLNNRXoj10RFI7Y8TPWFbZSh1yWb20Ui8fBGpYOkIQ+zfC1UalmQzbme46hYYvHOJD43b5NDbbdDHj76PdJ7KUT6d3V0=----ATTACHMENT:----NDE3OTE3NDY4MDIyMTEwIDUyODMyNTY0MTE0ODY3NTMgNTMzMTM3MjkxNzU1NjM1MA==