Ejemplo n.º 1
0
 /**
  * @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());
 }
Ejemplo n.º 2
0
 /**
  * @param mixed          $content
  * @param string         $websiteId
  * @param string         $pageId
  * @param string         $mode
  * @param array          $globalContent
  * @param \Cms\Data\Page $page
  * @param null           $codeType
  */
 public function renderPageContent($content, $websiteId, $pageId, $mode, $globalContent, $page, $codeType = null)
 {
     // Check page content and stop/break nicely
     $content = $this->convertContentToArray($content);
     if (empty($content)) {
         return;
     }
     // create item meta data
     $currentItemInfo = array('id' => $pageId, 'websiteId' => $websiteId, 'name' => $page->getName(), 'pageType' => $page->getPageType(), 'description' => $page->getDescription(), 'date' => $page->getDate(), 'inNavigation' => $page->getInnavigation(), 'navigationTitle' => $page->getNavigationtitle(), 'globalContent' => $globalContent);
     $this->renderWithNewRenderer($content, $websiteId, $pageId, $mode, $currentItemInfo, $codeType, false);
 }
Ejemplo n.º 3
0
 /**
  * @test
  * @group library
  */
 public function success()
 {
     $attributes = array('name' => 'new name', 'pageType' => 'the_new_page_type_id', 'pageAttributes' => (object) array('newKey' => 'newValue'));
     $this->assertNotEquals($attributes['name'], $this->testEntry->getName());
     $this->assertNotEquals($attributes['pageType'], $this->testEntry->getPageType());
     $this->assertNotEquals($attributes['pageAttributes'], json_decode($this->testEntry->getPageAttributes()));
     $lastUpdateBeforUpdate = $this->testEntry->getLastupdate();
     // kurz warten, damit updateTime geprueft werden kann (sonst ist Zeit zu kurz)
     sleep(1);
     $this->service->update($this->testEntry->getId(), $this->websiteId, $attributes);
     $page = $this->service->getById($this->testEntry->getId(), $this->websiteId);
     $this->assertEquals($attributes['name'], $page->getName());
     $this->assertEquals($attributes['pageType'], $page->getPageType());
     $this->assertEquals($attributes['pageAttributes'], json_decode($page->getPageAttributes()));
     // Timestamp der letzten Aenderung darf nicht aelter sein als ein paar Sekunden
     $this->assertNotNull($page->getLastupdate());
     $this->assertNotEquals($lastUpdateBeforUpdate, $page->getLastupdate());
     $currentTime = time();
     $this->assertLessThanOrEqual($currentTime, $page->getLastupdate());
     $this->assertGreaterThan($currentTime - 2, $page->getLastupdate());
 }
Ejemplo n.º 4
0
 protected function setValuesFromData(PageData $data)
 {
     $this->setId($data->getId());
     $this->setWebsiteId($data->getWebsiteid());
     $this->setTemplateId($data->getTemplateid());
     $this->setMediaId($data->getMediaId());
     $this->setName($data->getName());
     $this->setDescription($data->getDescription());
     $this->setInNavigation($data->getInnavigation());
     $this->setDate($data->getDate());
     $this->setNavigationTitle($data->getNavigationtitle());
     $this->setContent($data->getContent());
     $this->setPageType($data->getPageType());
     $this->setPageAttributes($data->getPageAttributes());
     $this->setScreenshot();
 }