/** * @skipUpgrade */ public function setUp() { parent::setUp(); $this->orig['Member_unique_identifier_field'] = Member::config()->unique_identifier_field; Member::config()->unique_identifier_field = 'Email'; Member::set_password_validator(null); }
public function setUp() { parent::setUp(); $this->logInWithPermission('ADMIN'); // Save versioned state $this->oldReadingMode = Versioned::get_reading_mode(); Versioned::set_stage(Versioned::DRAFT); // Set backend root to /UploadFieldTest AssetStoreTest_SpyStore::activate('UploadFieldTest'); // Set the File Name Filter replacements so files have the expected names Config::inst()->update('SilverStripe\\Assets\\FileNameFilter', 'default_replacements', array('/\\s/' => '-', '/_/' => '-', '/[^A-Za-z0-9+.\\-]+/' => '', '/[\\-]{2,}/' => '-', '/^[\\.\\-_]+/' => '')); // Create a test folders for each of the fixture references foreach (Folder::get() as $folder) { $path = AssetStoreTest_SpyStore::getLocalPath($folder); Filesystem::makeFolder($path); } // Create a test files for each of the fixture references $files = File::get()->exclude('ClassName', 'SilverStripe\\Assets\\Folder'); foreach ($files as $file) { $path = AssetStoreTest_SpyStore::getLocalPath($file); Filesystem::makeFolder(dirname($path)); $fh = fopen($path, "w+"); fwrite($fh, str_repeat('x', 1000000)); fclose($fh); } }
public function setUp() { parent::setUp(); $this->logInWithPermission('ADMIN'); Versioned::set_stage(Versioned::DRAFT); // Set backend root to /AssetFieldTest AssetStoreTest_SpyStore::activate('AssetFieldTest'); $create = function ($path) { Filesystem::makeFolder(dirname($path)); $fh = fopen($path, "w+"); fwrite($fh, str_repeat('x', 1000000)); fclose($fh); }; // Write all DBFile references foreach (AssetFieldTest_Object::get() as $object) { $path = AssetStoreTest_SpyStore::getLocalPath($object->File); $create($path); } // Create a test files for each of the fixture references $files = File::get()->exclude('ClassName', 'SilverStripe\\Assets\\Folder'); foreach ($files as $file) { $path = AssetStoreTest_SpyStore::getLocalPath($file); $create($path); } }
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 setUp() { parent::setUp(); // @todo fix controller stack problems and re-activate //$this->autoFollowRedirection = false; $this->resetMenu(); $this->backupCombined = Requirements::get_combined_files_enabled(); LeftAndMain::config()->update('extra_requirements_css', array(FRAMEWORK_DIR . '/tests/assets/LeftAndMainTest.css'))->update('extra_requirements_javascript', array(FRAMEWORK_DIR . '/tests/assets/LeftAndMainTest.js')); Requirements::set_combined_files_enabled(false); }
public function setUp() { parent::setUp(); // Set backend root to /HTMLEditorFieldTest AssetStoreTest_SpyStore::activate('HTMLEditorFieldTest'); // Set the File Name Filter replacements so files have the expected names Config::inst()->update('SilverStripe\\Assets\\FileNameFilter', 'default_replacements', array('/\\s/' => '-', '/_/' => '-', '/[^A-Za-z0-9+.\\-]+/' => '', '/[\\-]{2,}/' => '-', '/^[\\.\\-_]+/' => '')); // Create a test files for each of the fixture references $files = File::get()->exclude('ClassName', 'SilverStripe\\Assets\\Folder'); foreach ($files as $file) { $fromPath = FRAMEWORK_PATH . '/tests/forms/images/' . $file->Name; $destPath = AssetStoreTest_SpyStore::getLocalPath($file); // Only correct for test asset store Filesystem::makeFolder(dirname($destPath)); copy($fromPath, $destPath); } }
public function setUp() { // This test assumes that MemberAuthenticator is present and the default $this->priorAuthenticators = Authenticator::get_authenticators(); $this->priorDefaultAuthenticator = Authenticator::get_default_authenticator(); foreach ($this->priorAuthenticators as $authenticator) { Authenticator::unregister($authenticator); } Authenticator::register('SilverStripe\\Security\\MemberAuthenticator'); Authenticator::set_default_authenticator('SilverStripe\\Security\\MemberAuthenticator'); // And that the unique identified field is 'Email' $this->priorUniqueIdentifierField = Member::config()->unique_identifier_field; $this->priorRememberUsername = Security::config()->remember_username; /** @skipUpgrade */ Member::config()->unique_identifier_field = 'Email'; parent::setUp(); Config::inst()->update('SilverStripe\\Control\\Director', 'alternate_base_url', '/'); }
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 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 setUp() { parent::setUp(); Config::inst()->update('SilverStripe\\Control\\Director', 'alternate_base_url', '/'); $this->depSettings = Deprecation::dump_settings(); }
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")); }