Inheritance: extends TestCase
 /**
  * Avoid subsites filtering on fixture fetching.
  */
 function objFromFixture($class, $id)
 {
     Subsite::disable_subsite_filter(true);
     $obj = parent::objFromFixture($class, $id);
     Subsite::disable_subsite_filter(false);
     return $obj;
 }
	function setUp() {
		parent::setUp();
		
		$this->loginWithPermission('ADMIN');
		
		// creates a series of published, unpublished versions of a page
		$this->page = new Page();
		$this->page->URLSegment = "test";
		$this->page->Content = "new content";
		$this->page->write(); 
		$this->versionUnpublishedCheck = $this->page->Version;
		
		$this->page->Content = "some further content";
		$this->page->write();
		$this->page->publish('Stage', 'Live');
		$this->versionPublishCheck = $this->page->Version;
		
		$this->page->Content = "No, more changes please";
		$this->page->Title = "Changing titles too";
		$this->page->write();
		$this->versionUnpublishedCheck2 = $this->page->Version;
		
		$this->page->Title = "Final Change";
		$this->page->write();
		$this->page->publish('Stage', 'Live');
		$this->versionPublishCheck2 = $this->page->Version;
	}
 function tearDownOnce()
 {
     parent::tearDownOnce();
     DocumentationService::unregister("DocumentationViewerTests");
     DocumentationService::set_automatic_registration($this->origEnabled);
     DocumentationViewer::set_link_base($this->origLinkBase);
 }
Exemplo n.º 4
0
 public function setUp()
 {
     parent::setUp();
     Config::inst()->update('Director', 'rules', array('FormTest_Controller' => 'FormTest_Controller'));
     // Suppress themes
     Config::inst()->remove('SSViewer', 'theme');
 }
 /**
  * New tests require nested urls to be enabled, but the site might not 
  * support nested URLs. 
  * This setup will enable nested-urls for this test and resets the state
  * after the tests have been performed.
  */
 public function tearDown()
 {
     if (isset($this->orig['nested_urls']) && !$this->orig['nested_urls']) {
         SiteTree::config()->nested_urls = false;
     }
     parent::tearDown();
 }
 function setUp()
 {
     parent::setUp();
     $this->useDraftSite();
     // we're testing HTTP status codes before being redirected to login forms
     $this->autoFollowRedirection = false;
 }
 /**
  * New tests require nested urls to be enabled, but the site might not 
  * support nested URLs. 
  * This setup will enable nested-urls for this test and resets the state
  * after the tests have been performed.
  */
 function tearDown()
 {
     if (isset($this->orig['nested_urls']) && !$this->orig['nested_urls']) {
         SiteTree::disable_nested_urls();
     }
     parent::tearDown();
 }
 function tearDown()
 {
     parent::tearDown();
     // Static publishing will just confuse things
     StaticPublisher::$disable_realtime = false;
     i18n::set_locale($this->origLocale);
 }
Exemplo n.º 9
0
 public function setUp()
 {
     parent::setUp();
     $holderPage = $this->objFromFixture('SiteTree', 'searchformholder');
     $this->mockController = new ContentController($holderPage);
     $this->waitUntilIndexingFinished();
 }
Exemplo n.º 10
0
 public function setUp()
 {
     parent::setUp();
     ini_set('display_errors', 1);
     ini_set("log_errors", 1);
     error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
 }
Exemplo n.º 11
0
 public function setUp()
 {
     parent::setUp();
     // Fixtures assume Email is the field used to identify the log in identity
     Member::config()->unique_identifier_field = 'Email';
     Member::config()->lock_out_after_incorrect_logins = 10;
 }
Exemplo n.º 12
0
 public function setUp()
 {
     parent::setUp();
     $this->accountpage = $this->objFromFixture("AccountPage", "accountpage");
     $this->controller = new AccountPage_Controller($this->accountpage);
     $this->controller->init();
 }
 public function tearDown()
 {
     parent::tearDown();
     Config::inst()->update('LeftAndMain', 'extra_requirements_css', $this->backupCss);
     Config::inst()->update('LeftAndMain', 'extra_requirements_javascript', $this->backupJs);
     Requirements::set_combined_files_enabled($this->backupCombined);
 }
Exemplo n.º 14
0
 function setUp()
 {
     parent::setUp();
     // whenever a translation is created, canTranslate() is checked
     $cmseditor = $this->objFromFixture('Member', 'cmseditor');
     $cmseditor->logIn();
 }
 public function tearDown()
 {
     SecurityToken::enable();
     $this->folder->deleteDatabaseOnly();
     Filesystem::removeFolder($this->folder->getFullPath());
     parent::tearDown();
 }
Exemplo n.º 16
0
 public function setUp()
 {
     parent::setUp();
     $this->defaultToken = Config::inst()->get('TokenAuth', 'DevToken');
     // clear cache
     SS_Cache::factory('rest_cache')->clean(Zend_Cache::CLEANING_MODE_ALL);
 }
 /**
  * Test setting pagination properties and returning the object
  */
 public function setUp()
 {
     parent::setUp();
     $page = new SiteTree(['Title' => "Test Page", 'URLSegment' => 'test']);
     $page->write();
     $page->publish('Stage', 'Live');
 }
Exemplo n.º 18
0
 function setUp()
 {
     parent::setUp();
     // @todo fix controller stack problems and re-activate
     //$this->autoFollowRedirection = false;
     CMSMenu::populate_menu();
 }
 public function tearDown()
 {
     parent::tearDown();
     $_SERVER['HTTP_USER_AGENT'] = self::$originalUserAgent;
     $_SERVER['HTTP_HOST'] = self::$originalHost;
     $_SERVER['HTTP_ACCEPT'] = self::$originalAccept;
 }
 function setUp()
 {
     parent::setUp();
     $parent1_published = $this->objFromFixture('Page', 'parent1_published');
     $parent1_published->publish('Stage', 'Live');
     $child1_1_published = $this->objFromFixture('Page', 'child1_1_published');
     $child1_1_published->publish('Stage', 'Live');
     $child1_2_published = $this->objFromFixture('Page', 'child1_2_published');
     $child1_2_published->publish('Stage', 'Live');
     $child1_3_orphaned = $this->objFromFixture('Page', 'child1_3_orphaned');
     $child1_3_orphaned->ParentID = 9999;
     $child1_3_orphaned->write();
     $child1_4_orphaned_published = $this->objFromFixture('Page', 'child1_4_orphaned_published');
     $child1_4_orphaned_published->ParentID = 9999;
     $child1_4_orphaned_published->write();
     $child1_4_orphaned_published->publish('Stage', 'Live');
     $grandchild1_1_2_published = $this->objFromFixture('Page', 'grandchild1_1_2_published');
     $grandchild1_1_2_published->publish('Stage', 'Live');
     $grandchild1_1_3_orphaned = $this->objFromFixture('Page', 'grandchild1_1_3_orphaned');
     $grandchild1_1_3_orphaned->ParentID = 9999;
     $grandchild1_1_3_orphaned->write();
     $grandchild1_1_4_orphaned_published = $this->objFromFixture('Page', 'grandchild1_1_4_orphaned_published');
     $grandchild1_1_4_orphaned_published->ParentID = 9999;
     $grandchild1_1_4_orphaned_published->write();
     $grandchild1_1_4_orphaned_published->publish('Stage', 'Live');
     $child2_1_published_orphaned = $this->objFromFixture('Page', 'child2_1_published_orphaned');
     $child2_1_published_orphaned->publish('Stage', 'Live');
 }
 public function tearDown()
 {
     parent::tearDown();
     BasicAuth::protect_entire_site(false);
     Member::config()->unique_identifier_field = self::$original_unique_identifier_field;
     Security::$force_database_is_ready = null;
 }
	function setUp() {
		parent::setUp();
		
		$blogHolder = $this->objFromFixture('BlogHolder', 'blogholder');
		$blogHolder->publish('Stage', 'Live');
		$blogEntry = $this->objFromFixture('BlogEntry', 'entry1');
		$blogEntry->publish('Stage', 'Live');
	}
Exemplo n.º 23
0
 function tearDown()
 {
     parent::tearDown();
     ErrorPage::set_static_filepath($this->orig['ErrorPage_staticfilepath']);
     Director::set_environment_type($this->orig['Director_environmenttype']);
     Filesystem::removeFolder($this->tmpAssetsPath . '/ErrorPageTest');
     Filesystem::removeFolder($this->tmpAssetsPath);
 }
Exemplo n.º 24
0
 public function setUp()
 {
     parent::setUp();
     $this->list = new DataList('GridFieldTest_Team');
     $config = GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), new GridFieldPaginator(2), new GridFieldPageCount('toolbar-header-right'));
     $this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
     $this->form = new Form(new Controller(), 'mockform', new FieldList(array($this->gridField)), new FieldList());
 }
 public function tearDown()
 {
     $this->image->delete();
     if ($this->reference) {
         $this->reference->delete();
     }
     parent::tearDown();
 }
Exemplo n.º 26
0
 function setUp()
 {
     parent::setUp();
     $form = $this->objFromFixture('UserDefinedForm', 'basic-form-page');
     $controller = new FieldEditorTest_Controller($form);
     $fields = $controller->Form()->Fields();
     $this->editor = $fields->fieldByName('Fields');
 }
 public function setUp()
 {
     parent::setUp();
     Controller::add_extension('ShopTestControllerExtension');
     $this->accountpage = $this->objFromFixture("AccountPage", "accountpage");
     $this->controller = new AccountPage_Controller($this->accountpage);
     $this->controller->init();
 }
Exemplo n.º 28
0
 public function tearDown()
 {
     parent::tearDown();
     Config::inst()->remove('VirtualPage', 'initially_copied_fields');
     Config::inst()->remove('VirtualPage', 'non_virtual_fields');
     VirtualPage::config()->initially_copied_fields = $this->origInitiallyCopiedFields;
     VirtualPage::config()->non_virtual_fields = $this->origNonVirtualField;
 }
Exemplo n.º 29
0
 public function tearDown()
 {
     parent::tearDown();
     ErrorPage::config()->static_filepath = $this->orig['ErrorPage_staticfilepath'];
     Filesystem::removeFolder($this->tmpAssetsPath . '/ErrorPageTest');
     Filesystem::removeFolder($this->tmpAssetsPath);
     Config::inst()->update('Director', 'environment_type', $this->origEnvType);
 }
Exemplo n.º 30
0
 function tearDown()
 {
     parent::tearDown();
     /*
     Product::set_site_currency($this->orig['Product_site_currency']);
     Product::set_supported_currencies($this->orig['Product_supported_currencies']);
     */
 }