public function test_it_destroys_page() { $this->RoutesGenerator->shouldReceive('cacheRoutes')->once(); $this->PageManager->destroyPage(1); $deletedPage = \DvsPage::find(1); assertNull($deletedPage); }
public function test_it_can_delete_nonlive_page_version() { $page = \DvsPage::find(1); $pageVersion = \DvsPageVersion::find(2); $this->PagesRepository->shouldReceive('find')->andReturn($page); $this->PagesRepository->shouldReceive('getLivePageVersion')->andReturn($pageVersion); $this->PageVersionManager->destroyPageVersion(1); }
public function test_it_can_get_a_list_of_languages_available_for_specific_page() { $page = \DvsPage::find(1); $output = $this->LanguagesRepository->languageSelectorOptions($page); assertEquals($output, array('/admin/pages' => 'English')); }
public function test_it_finds_template_variables() { $templates = ['devise::admin.pages.index']; $realConfig = \Config::get('devise.templates'); $page = \DvsPage::find(1); $this->Config->shouldReceive('get')->once()->andReturn($realConfig); $vars = $this->PagesRepository->findTemplateVariables($templates); assertEquals(['languages', 'pages', 'templateList'], $vars); }
<?php $page = DvsPage::find(1); ?> <div data-devise="$page->view, The Page View"></div>
private function populateDvsPageData() { $page = \DvsPage::find(1); $this->TagManager->shouldReceive('initialize')->with(1, 1, 45); $this->dvsPageData->initialize(1, 1, 45, 'token'); $this->dvsPageData->register('key1', 'field', null, 'key1', 'text', 'Key 1', null, null, null, null); $this->dvsPageData->register('key2', 'field', null, 'key2', 'text', 'Key 2', null, null, null, null); $this->dvsPageData->register('col[key1]', 'collection', 'col', 'key1', 'text', 'Key 1', 'Collection Name', 'My Group Name', 'category', 'alternate target'); $this->dvsPageData->register('col[key2]', 'collection', 'col', 'key2', 'text', 'Key 2', 'Collection Name', 'My Group Name', 'category', 'alternate target'); $this->dvsPageData->register('col[key3]', 'collection', 'col', 'key3', 'text', 'Key 3', 'Collection Name', 'My Group Name', 'category', 'alternate target'); $this->dvsPageData->register('$page', 'variable', null, '$page', 'variable', 'Page', null, null, null, null); $this->dvsPageData->register('$page->view', 'variable', null, '$page->view', 'variable', 'The Page View', null, null, null, null); $this->dvsPageData->register('creator.07bc2f9dadb7314768a55b1f9cd404dc', 'creator', null, 'DvsPage', 'creator', 'The Page Creator', null, null, null, null); $this->dvsPageData->cid('key1', 'field', null, 'key1', 'text', 'Key 1', null, null, null, null, null); $this->dvsPageData->cid('key2', 'field', null, 'key2', 'text', 'Key 2', null, 'My Group Name', null, null, null); $this->dvsPageData->cid('col[key1]', 'collection', 'col', 'key1', 'text', 'Key 1', 'Collection Name', 'My Group Name', 'category', 'alternate target', null); $this->dvsPageData->cid('col[key2]', 'collection', 'col', 'key2', 'text', 'Key 2', 'Collection Name', 'My Group Name', 'category', 'alternate target', null); $this->dvsPageData->cid('col[key3]', 'collection', 'col', 'key3', 'text', 'Key 3', 'Collection Name', 'My Group Name', 'category', 'alternate target', null); $this->dvsPageData->cid('$page', 'variable', null, ['$page' => $page], 'variable', 'Page', null, null, null, null, null); $this->dvsPageData->cid('$page->view', 'variable', null, ['view' => $page->view, '$page' => $page], 'variable', 'The Page View', null, null, null, null, null); $this->dvsPageData->cid('creator.07bc2f9dadb7314768a55b1f9cd404dc', 'creator', null, 'DvsPage', 'creator', 'The Page Creator', null, null, null, null, null); }