Inheritance: extends Illuminate\Database\Eloquent\Model, use trait Devise\Support\Sortable\Sortable
Exemplo n.º 1
0
 public function test_it_handles_filtering()
 {
     \Input::merge(['dvs-filters' => ['slug' => '/admin/media-manager/category']]);
     $pages = \DvsPage::paginate();
     // are pages filtered?
     // assertCount(2, $pages);
 }
Exemplo n.º 2
0
 public function test_it_destroys_page()
 {
     $this->RoutesGenerator->shouldReceive('cacheRoutes')->once();
     $this->PageManager->destroyPage(1);
     $deletedPage = \DvsPage::find(1);
     assertNull($deletedPage);
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 public function setUp()
 {
     parent::setUp();
     \DvsPage::create(['id' => 9999, 'language_id' => 45, 'title' => 'Some title', 'is_admin' => 0, 'dvs_admin' => 0, 'route_name' => 'some-route-name', 'slug' => 'some/route']);
     \DvsPageVersion::create(['id' => 9999, 'page_id' => 9999, 'created_by_user_id' => 0, 'name' => 'Default', 'starts_at' => '2015-01-02 00:00:00', 'ends_at' => '2015-01-03 00:00:00']);
     $this->Framework = new \Devise\Support\Framework();
     $this->Framework->URL = m::mock('MockedURL');
     $this->Framework->URL->shouldReceive('route')->andReturn('admin/calendar/sources/page-versions/id');
     $this->PageVersionSource = new PageVersionSource(new \DvsPageVersion(), $this->Framework);
 }
Exemplo n.º 5
0
 public function test_it_overrides_new_query()
 {
     $pages = new \DvsPage();
     $builder = $pages->newQuery();
     assertInstanceOf('Devise\\Support\\Sortable\\EloquentBuilder', $builder);
 }
Exemplo n.º 6
0
 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'));
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
<?php

$page = DvsPage::find(1);
?>
<div data-devise="$page->view, The Page View"></div>
Exemplo n.º 9
0
 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);
 }