/** * */ public function testDumpLocation() { $locationEntity = new LocationEntity(); $locationEntity->setLocation('http://test.com/'); $locationEntity->setLastmod(new \DateTime('2015-09-10')); $this->siteMapEntity->addLocation($locationEntity); $this->assertRegExp('/\\<url\\>\\<loc\\>http\\:\\/\\/test\\.com\\/\\<\\/loc\\>\\<lastmod\\>2015\\-09\\-10\\<\\/lastmod\\>\\<\\/url\\>/', $this->siteMapEntity->getXml()); }
/** * */ public function testNewsCollection() { $newsEntity = new NewsEntity(); $newsEntity->setPublicationName('test'); $newsEntity->setPublicationLanguage('en'); $this->locationEntity->addNews($newsEntity); $this->assertRegExp('/\\<news\\:news\\>/', $this->locationEntity->getXml()); $this->assertRegExp('/\\<news\\:publication\\>/', $this->locationEntity->getXml()); $this->assertRegExp('/\\<news\\:name\\>test\\<\\/news\\:name\\>/', $this->locationEntity->getXml()); $this->assertRegExp('/\\<news\\:language\\>en\\<\\/news\\:language\\>/', $this->locationEntity->getXml()); $this->assertRegExp('/\\<\\/news\\:publication\\>/', $this->locationEntity->getXml()); $this->assertRegExp('/\\<\\/news\\:news\\>/', $this->locationEntity->getXml()); }