public function testShadowStartPage() { $data = ['title' => 'startpage', 'tags' => ['tag1', 'tag2'], 'url' => '/', 'article' => 'article']; $this->mapper->saveStartPage($data, 'overview', 'sulu_io', 'en', 1, false); $this->mapper->saveStartPage(['title' => 'Startseite'], 'overview', 'sulu_io', 'de', 1, false, true, 'en'); $startPage = $this->mapper->loadStartPage('sulu_io', 'de'); $this->assertEquals('startpage', $startPage->title); $this->assertEquals('/', $startPage->url); }
public function testLoadWithSmartContent() { $startPage = $this->mapper->loadStartPage('sulu_io', 'de'); $data = ContentMapperRequest::create('page')->setLocale('de')->setTemplateKey('overview_smart_content')->setData(['title' => 'Testname', 'tags' => ['tag1', 'tag2'], 'url' => '/news', 'article' => 'sulu_io', 'smartcontent' => ['dataSource' => $startPage->getUuid()]])->setWebspaceKey('sulu_io')->setState(Structure::STATE_PUBLISHED)->setUserId(1); $structure = $this->mapper->saveRequest($data); $childData = ContentMapperRequest::create('page')->setLocale('de')->setTemplateKey('default')->setData(['title' => 'Testname', 'url' => '/news/child', 'article' => 'sulu_io'])->setWebspaceKey('sulu_io')->setState(Structure::STATE_PUBLISHED)->setUserId(1); $childStructure = $this->mapper->saveRequest($childData); $content = $this->mapper->load($structure->getUuid(), 'sulu_io', 'de'); $smartContentType = $this->contentTypeManager->get('smart_content'); $smartContentData = $smartContentType->getContentData($content->getProperty('smartcontent')); $this->assertInstanceOf('DateTime', $smartContentData[0]['published']); }