/** * Test... * * @return void */ public function testRender() { $this->object->setShortName('ShortName'); $this->object->setDescription('Description'); $item = new JOpenSearchUrl; $item->template = 'http://www.example.com'; $item2 = new JOpenSearchUrl; $item2->template = 'http://www.example.com?format=feed'; $item2->type = 'application/rss+xml'; $item2->rel = 'suggestions'; $this->object->addUrl($item); $this->object->addUrl($item2); $expected = '<?xml version="1.0" encoding="utf-8"?>' . PHP_EOL . '<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"><ShortName>ShortName</ShortName>' . '<Description>Description</Description><InputEncoding>UTF-8</InputEncoding>' . '<Url type="application/opensearchdescription+xml" rel="self" template=""/>' . '<Url type="text/html" template="http://www.example.com"/>' . '<Url type="application/rss+xml" rel="suggestions" template="http://www.example.com?format=feed"/>' . '</OpenSearchDescription>' . PHP_EOL; $this->assertThat( $this->object->render(), $this->equalTo($expected) ); }
public function testRender() { $this->object->setShortName('ShortName'); $this->object->setDescription('Description'); $item = new JOpenSearchUrl(array('template' => 'http://www.example.com')); $item2 = new JOpenSearchUrl(array('template' => 'http://www.example.com?format=feed', 'type' => 'application/rss+xml', 'rel' => 'suggestions')); $this->object->addUrl($item); $this->object->addUrl($item2); $this->assertThat($this->object->render(), $this->equalTo('<?xml version="1.0" encoding="utf-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>ShortName</ShortName> <Description>Description</Description> <InputEncoding>UTF-8</InputEncoding> <Url type="application/opensearchdescription+xml" rel="self" template=""/> <Url type="text/html" template="http://www.example.com"/> <Url type="application/rss+xml" rel="suggestions" template="http://www.example.com?format=feed"/> </OpenSearchDescription> ')); }
/** * @testdox Test that setShortName returns an instance of $this */ public function testEnsureSetShortNameReturnsThisObject() { $this->assertSame($this->object, $this->object->setShortName('CMS')); }