* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class AtomTest extends TestCase { public function testModel() { $person = new Person(); $person->setName('foobar'); $person->setUri('http://foo.com'); $person->setEmail('foo@bar.com'); $category = new Category(); $category->setTerm('foobar'); $category->setScheme('http://foo.com'); $category->setLabel('Foobar'); $text = new Text(); $text->setContent('foobar'); $link = new Link(); $link->setHref('http://localhost.com'); $link->setRel('me'); $link->setType('application/xml'); $link->setHreflang('en'); $link->setTitle('Foobar'); $link->setLength(1337); $entry = new Entry(); $entry->setAuthor([$person]); $entry->setCategory([$category]); $entry->setContent($text); $entry->setContributor([$person]); $entry->setId('http://localhost.com#1'); $entry->setRights('foo'); $entry->setTitle('Star City'); $entry->setPublished(new \DateTime('Tue, 10 Jun 2003 04:00:00 GMT')); $entry->setUpdated(new \DateTime('Tue, 10 Jun 2003 04:00:00 GMT')); $entry->setLink([$link]); $entry->setSummary($text); $generator = new Generator(); $generator->setText('foobar'); $generator->setUri('http://foo.com'); $generator->setVersion('1.0'); $atom = new Atom(); $atom->setAuthor([$person]); $atom->setCategory([$category]); $atom->setContributor([$person]); $atom->setGenerator($generator); $atom->setIcon('http://localhost.com/icon.png'); $atom->setLogo('http://localhost.com/logo.png'); $atom->setId('http://localhost.com#1'); $atom->setRights('foo'); $atom->setTitle('Foo has bar'); $atom->setUpdated(new \DateTime('Tue, 10 Jun 2003 04:00:00 GMT')); $atom->setLink([$link]); $atom->setSubTitle($text); $atom->setEntry([$entry]); $dumper = new Dumper(); $actual = json_encode($dumper->dump($atom), JSON_PRETTY_PRINT); $expect = file_get_contents(__DIR__ . '/resource/atom.json'); $this->assertJsonStringEqualsJsonString($expect, $actual, $actual); } } __halt_compiler();----SIGNATURE:----l/UStv5O5xkJxHRubUnLTEo11efkF+K1DAOHwYiSjAUVvQTfQ/68gMtByzqJd9EAJN7w+S30434LbnapjDf7cYQ6GGZIsw7s/pSr3hwMY4lTeXFlNfwgeqYrQFrCTOhr4g0BSE3gv0AgILhGsfFY1QWLi0TWlLFN7dDgkEaJ7H5Svn7fOhMrYMUDRRM982zKVOV9GK3C+SKMKUnSwaz2YmwFS7rRhepeECDaRX/genBuYRA3Rr6eS/TGXvxqsNGYxK11ddBoVINrijmS39uX7bg8NqBm+V0uuaLFzXs3X4PBfndCzT40QkL8Bv4tbboo+QGbx+1Ae/FqtS5DDj3RqAQnHFSCjmD/wMXcNZtMEmguWM/L61WTbv2ZfzcdceSlKyCdBK9k0T+mmuabePCPV34S/s2XU/nQ0eZ7hf+PGMc+vvO+ifai9guQ/CHofLYlf+Q9LjFxPbPBjpz1pnf3PfE5+ssdq8JqBjShLyQtwuNJ/baekweaqv26RCRWzUuOyC8OvxAGINQKcRBkRc434yilCpMq9Mw2dPnbEPbyLZcbvsndlKydYEqD1UNnFaGrpeTf776y+56/FAvCfzQZBqK/SsspBs7Uh3GoebwrqLLSIa4Tt7YFNBKBOu4KB8Vo3pZWjyznncjZs5Pi91PEpc8bIhV6mAzvQ/yws1Gg+YI=----ATTACHMENT:----NDE2MzI5MTE4MTg1MTA5MSA1MTg2MzA5Njc0MTE4Mzg1IDc0ODU5NDA2MzMyOTcwOTA=