public function tearDown()
 {
     parent::tearDown();
     $_SERVER['HTTP_USER_AGENT'] = self::$originalUserAgent;
     $_SERVER['HTTP_HOST'] = self::$originalHost;
     $_SERVER['HTTP_ACCEPT'] = self::$originalAccept;
 }
 /**
  * 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();
 }
 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;
 }
 /**
  * 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();
 }
 public function tearDown()
 {
     SecurityToken::enable();
     $this->folder->deleteDatabaseOnly();
     Filesystem::removeFolder($this->folder->getFullPath());
     parent::tearDown();
 }
 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);
 }
 function tearDown()
 {
     parent::tearDown();
     // Static publishing will just confuse things
     StaticPublisher::$disable_realtime = false;
     i18n::set_locale($this->origLocale);
 }
 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.º 9
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);
 }
 public function tearDown()
 {
     $this->image->delete();
     if ($this->reference) {
         $this->reference->delete();
     }
     parent::tearDown();
 }
 public function tearDown()
 {
     AssetStoreTest_SpyStore::reset();
     if ($this->oldReadingMode) {
         Versioned::set_reading_mode($this->oldReadingMode);
     }
     parent::tearDown();
 }
Exemplo n.º 12
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.º 13
0
 function tearDown()
 {
     parent::tearDown();
     /*
     Product::set_site_currency($this->orig['Product_site_currency']);
     Product::set_supported_currencies($this->orig['Product_supported_currencies']);
     */
 }
	public function tearDown() {
		Object::add_static_var('GalleristPageDecorator', 'markup_template', $this->oldMarkupTemplate, true);
		Object::add_static_var('Page', 'gallerist_active', $this->oldGalleristActive, true);
		foreach($this->allFixtureIDs('Image') as $fileID) {
			$file = DataObject::get_by_id('Image', $fileID);
			$file->delete();
		}
		parent::tearDown();
	}
Exemplo n.º 15
0
 public function tearDown()
 {
     if ($this->securityEnabled) {
         SecurityToken::enable();
     } else {
         SecurityToken::disable();
     }
     parent::tearDown();
 }
Exemplo n.º 16
0
	function tearDown() {
		if(!$this->origTranslatableSettings['enabled']) Translatable::disable();
		Translatable::set_default_lang($this->origTranslatableSettings['default_lang']);
		
		self::kill_temp_db();
		self::create_temp_db();
		
		parent::tearDown();
	}
Exemplo n.º 17
0
 function tearDown()
 {
     // Restore selected authenticator
     // MemberAuthenticator might not actually be present
     if (!in_array('MemberAuthenticator', $this->priorAuthenticators)) {
         Authenticator::unregister('MemberAuthenticator');
     }
     Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
     parent::tearDown();
 }
Exemplo n.º 18
0
 public function tearDown()
 {
     parent::tearDown();
     //if the token is turned on reset it before the next test run
     if ($this->useToken) {
         SecurityToken::enable();
     } else {
         SecurityToken::disable();
     }
 }
 function tearDown()
 {
     parent::tearDown();
     //get rid of all lingering modifiers, order items etc
     if ($attributes = DataObject::get('OrderAttribute')) {
         foreach ($attributes as $attribute) {
             $attribute->delete();
             $attribute->destroy();
         }
     }
 }
 public function tearDown()
 {
     if ($this->securityWasEnabled) {
         SecurityToken::enable();
     } else {
         SecurityToken::disable();
     }
     Injector::unnest();
     Config::unnest();
     parent::tearDown();
 }
 public function tearDown()
 {
     // remove db records otherwise we end up with multiple stats
     foreach (URLStatistics::get() as $stat) {
         $stat->delete();
     }
     foreach (SocialQueue::get() as $queue) {
         $queue->delete();
     }
     parent::tearDown();
 }
Exemplo n.º 22
0
 function tearDown()
 {
     // Restore selected authenticator
     // MemberAuthenticator might not actually be present
     if (!in_array('MemberAuthenticator', $this->priorAuthenticators)) {
         Authenticator::unregister('MemberAuthenticator');
     }
     Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
     // Restore unique identifier field
     Member::set_unique_identifier_field($this->priorUniqueIdentifierField);
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     if (file_exists(ASSETS_PATH . "/{$this->sitemap}")) {
         unlink(ASSETS_PATH . "/{$this->sitemap}");
     }
     $pages = Page::get();
     foreach ($pages as $page) {
         $page->delete();
     }
     $pages = SiteMapPage::get();
     foreach ($pages as $page) {
         $page->delete();
     }
 }
 public function tearDown()
 {
     MultilingualRootURLController::set_use_locale_url($this->origLocaleRoutingEnabled);
     Translatable::set_current_locale($this->origCurrentLocale);
     Translatable::set_default_locale($this->origLocale);
     Translatable::set_allowed_locales($this->origAllowedLocales);
     i18n::set_locale($this->origi18nLocale);
     Cookie::force_expiry('language');
     if ($this->origCookieLocale) {
         Cookie::set('language', $this->origCookieLocale);
     }
     $_SERVER['HTTP_ACCEPT_LANGUAGE'] = $this->origAcceptLanguage;
     MultilingualRootURLController::reset();
     parent::tearDown();
 }
 public function tearDown()
 {
     parent::tearDown();
     /* Remove the test files that we've created */
     $fileIDs = $this->allFixtureIDs('File');
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('File', $fileID);
         if ($file && file_exists(BASE_PATH . "/{$file->Filename}")) {
             unlink(BASE_PATH . "/{$file->Filename}");
         }
     }
     // Remove left over folders and any files that may exist
     if (file_exists('../assets/FileTest.txt')) {
         unlink('../assets/FileTest.txt');
     }
 }
Exemplo n.º 26
0
 public function tearDown()
 {
     // Restore selected authenticator
     // MemberAuthenticator might not actually be present
     if (!in_array('MemberAuthenticator', $this->priorAuthenticators)) {
         Authenticator::unregister('MemberAuthenticator');
     }
     foreach ($this->priorAuthenticators as $authenticator) {
         Authenticator::register($authenticator);
     }
     Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
     // Restore unique identifier field
     Member::config()->unique_identifier_field = $this->priorUniqueIdentifierField;
     Security::config()->remember_username = $this->priorRememberUsername;
     parent::tearDown();
 }
Exemplo n.º 27
0
 function tearDown()
 {
     parent::tearDown();
     self::$is_running_test = true;
     $d = DataObject::get("DMSDocument");
     foreach ($d as $d1) {
         $d1->delete();
     }
     $t = DataObject::get("DMSTag");
     foreach ($t as $t1) {
         $t1->delete();
     }
     //delete the test folder after the test runs
     $this->delete(BASE_PATH . DIRECTORY_SEPARATOR . 'dms-assets-test-1234');
     //set the old DMS folder back again
     DMS::$dmsFolder = self::$dmsFolderOld;
     DMS::$dmsFolderSize = self::$dmsFolderSizeOld;
     self::$is_running_test = $this->originalIsRunningTest;
 }
 function tearDown()
 {
     /* Remove the test files that we've created */
     $fileIDs = $this->allFixtureIDs('File');
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('File', $fileID);
         if (file_exists(BASE_PATH . "/{$file->Filename}")) {
             unlink(BASE_PATH . "/{$file->Filename}");
         }
     }
     /* Remove the test folders that we've crated */
     $fileIDs = array_reverse($this->allFixtureIDs('Folder'));
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('Folder', $fileID);
         if (file_exists(BASE_PATH . "/{$file->Filename}")) {
             rmdir(BASE_PATH . "/{$file->Filename}");
         }
     }
     if (!in_array('MemberAuthenticator', $this->priorAuthenticators)) {
         Authenticator::unregister('MemberAuthenticator');
     }
     Authenticator::set_default_authenticator($this->priorDefaultAuthenticator);
     parent::tearDown();
 }
Exemplo n.º 29
0
 public function tearDown()
 {
     Member::config()->unique_identifier_field = $this->orig['Member_unique_identifier_field'];
     parent::tearDown();
 }
 public function tearDown()
 {
     AssetStoreTest_SpyStore::reset();
     parent::tearDown();
 }