Example #1
0
 public function testCreateRssXml()
 {
     $dataProvider = $this->getMock('Magento\\Framework\\App\\Rss\\DataProviderInterface');
     $dataProvider->expects($this->any())->method('getCacheKey')->will($this->returnValue('cache_key'));
     $dataProvider->expects($this->any())->method('getCacheLifetime')->will($this->returnValue(100));
     $dataProvider->expects($this->any())->method('getRssData')->will($this->returnValue($this->feedData));
     $this->rss->setDataProvider($dataProvider);
     $result = $this->rss->createRssXml();
     $this->assertContains('<?xml version="1.0" encoding="UTF-8"?>', $result);
     $this->assertContains('<title><![CDATA[Feed Title]]></title>', $result);
     $this->assertContains('<title><![CDATA[Feed 1 Title]]></title>', $result);
     $this->assertContains('<link>http://magento.com/rss/link</link>', $result);
     $this->assertContains('<link>http://magento.com/rss/link/id/1</link>', $result);
     $this->assertContains('<description><![CDATA[Feed Description]]></description>', $result);
     $this->assertContains('<description><![CDATA[Feed 1 Description]]></description>', $result);
 }
Example #2
0
 public function testCreateRssXmlError()
 {
     $this->model->_addHeader(['test']);
     $this->assertEquals('Error in processing xml. title key is missing', $this->model->createRssXml());
 }