/** * @param \Cms\Data\Page $result * @param string $expectedData */ protected function assertResultSuccess($result, $expectedData = '') { $this->assertInstanceOf('Cms\\Data\\Page', $result); $this->assertSame($result->getName(), $expectedData); $this->assertNotSame($result->getId(), $this->testEntry->getId()); $this->assertSame($result->getWebsiteId(), $this->testEntry->getWebsiteId()); $this->assertEquals($result->getPageType(), $this->testEntry->getPageType()); $this->assertEquals($result->getPageAttributes(), $this->testEntry->getPageAttributes()); }
/** * Page reparsen und updaten * * @param Cms\Data\Page $page * @param Cms\Data\Template $template * @param string $reparseType */ public static function reparseAndUpdatePage(Page &$page, Template $template, $reparseType = self::TYPE_REPARSE) { // Content reparsen $newPageContent = array(); $newPageContent = self::reparseContent($page->getWebsiteid(), $page->getContent(), $page->getTemplatecontent(), $template->getContent(), $reparseType); // Page mit den neuen Werten updaten $page->setContent(\Zend_Json::encode($newPageContent)); $page->setTemplatecontent($template->getContent()); $page->setTemplatecontentchecksum($template->getContentchecksum()); // Page speichern $pageBusiness = new \Cms\Business\Page('Page'); $pageBusiness->update($page->getId(), $page->getWebsiteId(), array('content' => \Zend_Json::encode($newPageContent), 'templatecontent' => $template->getContent(), 'templatecontentchecksum' => $template->getContentchecksum())); return true; }
/** * @test * @group library * @expectedException \Cms\Exception */ public function idNotFound() { $id = 'TEST-123'; $result = $this->service->getById($id, $this->testEntry->getWebsiteId()); }
/** * Reparsen einer Page * * @param Cms\Data\Page $page */ public function reparsePage(\Cms\Data\Page $page) { $template = $this->getTemplateBusiness()->getById($page->getTemplateId(), $page->getWebsiteId()); return $this->doReparsePage($page, $template); }