public function setUp() { parent::setUp(); Director::config()->update('rules', array('FormTest_Controller' => 'FormTest_Controller')); // Suppress themes SSViewer::config()->remove('theme'); }
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 setUp() { parent::setUp(); // Fixtures assume Email is the field used to identify the log in identity Member::config()->unique_identifier_field = 'Email'; Security::$force_database_is_ready = true; // Prevents Member test subclasses breaking ready test Member::config()->lock_out_after_incorrect_logins = 10; }
public function tearDown() { // Restore selected authenticator // MemberAuthenticator might not actually be present if (!in_array('SilverStripe\\Security\\MemberAuthenticator', $this->priorAuthenticators)) { Authenticator::unregister('SilverStripe\\Security\\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(); }
public function setUp() { parent::setUp(); // Set backend root to /ImageTest AssetStoreTest_SpyStore::activate('ProtectedFileControllerTest'); // Create a test folders for each of the fixture references foreach (Folder::get() as $folder) { /** @var Folder $folder */ $filePath = AssetStoreTest_SpyStore::getLocalPath($folder); Filesystem::makeFolder($filePath); } // Create a test files for each of the fixture references foreach (File::get()->exclude('ClassName', 'SilverStripe\\Assets\\Folder') as $file) { /** @var File $file */ $path = AssetStoreTest_SpyStore::getLocalPath($file); Filesystem::makeFolder(dirname($path)); $fh = fopen($path, "w+"); fwrite($fh, str_repeat('x', 1000000)); fclose($fh); // Create variant for each file $this->getAssetStore()->setFromString(str_repeat('y', 100), $file->Filename, $file->Hash, 'variant'); } }
public function post($url, $data, $headers = null, $session = null, $body = null, $cookies = null) { // Inject stage=Stage into the URL, to force working on draft $url = $this->addStageToUrl($url); return parent::post($url, $data, $headers, $session, $body, $cookies); }
public function tearDown() { parent::tearDown(); Requirements::set_combined_files_enabled($this->backupCombined); }
public function tearDown() { AssetStoreTest_SpyStore::reset(); parent::tearDown(); }
public function tearDown() { Member::config()->unique_identifier_field = $this->orig['Member_unique_identifier_field']; parent::tearDown(); }
public function setUp() { parent::setUp(); Config::inst()->update('SilverStripe\\Dev\\DevelopmentAdmin', 'registered_controllers', array('x1' => array('controller' => 'DevAdminControllerTest_Controller1', 'links' => array('x1' => 'x1 link description', 'x1/y1' => 'x1/y1 link description')), 'x2' => array('controller' => 'DevAdminControllerTest_Controller2', 'links' => array('x2' => 'x2 link description')))); }
public function tearDown() { Deprecation::restore_settings($this->depSettings); parent::tearDown(); }
public function setUp() { parent::setUp(); Director::config()->update('rules', array('testGoodBase1' => "RequestHandlingTest_Controller", 'testGoodBase2//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller", 'testBadBase/$Action/$ID/$OtherID' => "RequestHandlingTest_Controller", 'testBaseWithExtension/virtualfile.xml' => "RequestHandlingTest_Controller", 'testBaseWithExtension//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller", 'testParentBase/testChildBase//$Action/$ID/$OtherID' => "RequestHandlingTest_Controller")); }