public function setUp() {
		parent::setUp();
		$this->list = new DataList('GridFieldAction_Delete_Team');
		$config = GridFieldConfig::create()->addComponent(new GridFieldDeleteAction());
		$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();
     // This test tests code that was deprecated after 2.4
     $this->originalDeprecation = Deprecation::dump_settings();
     Deprecation::notification_version('2.4');
 }
 public function setUp()
 {
     parent::setUp();
     if (!class_exists('FileSystemContentSource')) {
         throw new Exception("You must have the filesystem connector installed to use for testing");
     }
 }
 public function setUp()
 {
     // backup the project unique identifier field
     $this->member_unique_identifier_field = Member::config()->unique_identifier_field;
     Member::config()->unique_identifier_field = 'Email';
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     StaticPagesQueueEvent::clear();
     Config::inst()->nest();
     Config::inst()->update('StaticPagesQueue', 'realtime', true);
 }
 public function setUp()
 {
     parent::setUp();
     // Set backend and base url
     \Versioned::reading_stage('Stage');
     AssetStoreTest_SpyStore::activate('AssetControlExtensionTest');
     $this->logInWithPermission('ADMIN');
     // Setup fixture manually
     $object1 = new AssetControlExtensionTest_VersionedObject();
     $object1->Title = 'My object';
     $fish1 = realpath(__DIR__ . '/../model/testimages/test-image-high-quality.jpg');
     $object1->Header->setFromLocalFile($fish1, 'Header/MyObjectHeader.jpg');
     $object1->Download->setFromString('file content', 'Documents/File.txt');
     $object1->write();
     $object1->doPublish();
     $object2 = new AssetControlExtensionTest_Object();
     $object2->Title = 'Unversioned';
     $object2->Image->setFromLocalFile($fish1, 'Images/BeautifulFish.jpg');
     $object2->write();
     $object3 = new AssetControlExtensionTest_ArchivedObject();
     $object3->Title = 'Archived';
     $object3->Header->setFromLocalFile($fish1, 'Archived/MyObjectHeader.jpg');
     $object3->write();
     $object3->doPublish();
 }
 public function setUp()
 {
     parent::setUp();
     SiteTree::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
     $this->orig['domain_based_caching'] = Config::inst()->get('FilesystemPublisher', 'domain_based_caching');
     Config::inst()->update('FilesystemPublisher', 'domain_based_caching', false);
 }
 public function setUp()
 {
     parent::setUp();
     Config::nest();
     // Two restarts are allowed per job
     Config::inst()->update('QueuedJobService', 'stall_threshold', 2);
 }
 public function setUp()
 {
     parent::setUp();
     if (!file_exists(ASSETS_PATH)) {
         mkdir(ASSETS_PATH);
     }
     // Create a test folder for each of the fixture references
     $folderIDs = $this->allFixtureIDs('Folder');
     foreach ($folderIDs as $folderID) {
         $folder = DataObject::get_by_id('Folder', $folderID);
         if (!file_exists(BASE_PATH . "/{$folder->Filename}")) {
             mkdir(BASE_PATH . "/{$folder->Filename}");
         }
     }
     // Create a test file for each of the fixture references
     $fileIDs = $this->allFixtureIDs('File');
     foreach ($fileIDs as $fileID) {
         $file = DataObject::get_by_id('File', $fileID);
         $fh = fopen(BASE_PATH . "/{$file->Filename}", "w");
         fwrite($fh, '"Option","Count"' . PHP_EOL);
         fwrite($fh, '"Apple",13' . PHP_EOL);
         fwrite($fh, '"Banana",3' . PHP_EOL);
         fwrite($fh, '"Cherry",6' . PHP_EOL);
         fwrite($fh, '"Grapefruit",3' . PHP_EOL);
         fclose($fh);
     }
 }
 public function setUp()
 {
     parent::setUp();
     ShopTest::setConfiguration();
     $this->cart = $this->objFromFixture("Order", "cart");
     $this->othercart = $this->objFromFixture("Order", "othercart");
 }
	public function setUp() {
		parent::setUp();

		$this->list = new DataList('GridFieldExportButtonTest_Team');
		$config = GridFieldConfig::create()->addComponent(new GridFieldExportButton());
		$this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
	}
Beispiel #12
0
 public function setUp()
 {
     parent::setUp();
     Config::inst()->update('SSViewer', 'source_file_comments', false);
     Config::inst()->update('SSViewer_FromString', 'cache_template', false);
     $this->oldServer = $_SERVER;
 }
 public function setUp()
 {
     parent::setUp();
     $this->ball = $this->objFromFixture("Product", "ball");
     $this->mp3player = $this->objFromFixture("Product", "mp3player");
     $this->redlarge = $this->objFromFixture("ProductVariation", "redlarge");
 }
Beispiel #14
0
 public function setUp()
 {
     // Set timezone to support timestamp->date conversion.
     $this->originalTZ = date_default_timezone_get();
     date_default_timezone_set('Pacific/Auckland');
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
     $this->rootDir = ASSETS_PATH . '/AssetAdapterTest';
     Filesystem::makeFolder($this->rootDir);
     $this->originalServer = $_SERVER;
 }
 public function setUp()
 {
     parent::setUp();
     $this->base = dirname(__FILE__) . '/fixtures/namespaced_classmanifest';
     $this->manifest = new SS_ClassManifest($this->base, false, true, false);
     SS_ClassLoader::instance()->pushManifest($this->manifest, false);
 }
 public function setUp()
 {
     parent::setUp();
     $this->orig['File_searchable'] = Object::has_extension('File', 'FulltextSearchable');
     // TODO This shouldn't need all arguments included
     Object::remove_extension('File', 'FulltextSearchable(\'"Filename","Title","Content"\')');
 }
 public function setUp()
 {
     if (get_class($this) == "ImageTest") {
         $this->skipTest = true;
     }
     parent::setUp();
     if ($this->skipTest) {
         return;
     }
     // Set backend root to /ImageTest
     AssetStoreTest_SpyStore::activate('ImageTest');
     // Copy test images for each of the fixture references
     $files = File::get()->exclude('ClassName', 'Folder');
     foreach ($files as $image) {
         $filePath = AssetStoreTest_SpyStore::getLocalPath($image);
         // Only correct for test asset store
         $sourcePath = BASE_PATH . '/framework/tests/model/testimages/' . $image->Name;
         if (!file_exists($filePath)) {
             SS_Filesystem::makeFolder(dirname($filePath));
             if (!copy($sourcePath, $filePath)) {
                 user_error('Failed to copy test images', E_USER_ERROR);
             }
         }
     }
 }
 public function setUp()
 {
     parent::setUp();
     Config::nest();
     Config::inst()->update('HtmlEditorField_Toolbar', 'fileurl_scheme_whitelist', array('http'));
     Config::inst()->update('HtmlEditorField_Toolbar', 'fileurl_domain_whitelist', array('example.com'));
 }
 public function setUp()
 {
     parent::setUp();
     ini_set('display_errors', 1);
     ini_set("log_errors", 1);
     error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
 }
 public function setUp()
 {
     parent::setUp();
     // Set backend
     AssetStoreTest_SpyStore::activate('DBFileTest');
     Config::inst()->update('Director', 'alternate_base_url', '/mysite/');
 }
Beispiel #22
0
 function setUp()
 {
     // backup the project unique identifier field
     $this->member_unique_identifier_field = Member::get_unique_identifier_field();
     Member::set_unique_identifier_field('Email');
     parent::setUp();
 }
Beispiel #23
0
	function setUp() {
		parent::setUp();
		
		if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH);

		// Create a test folders for each of the fixture references
		$folderIDs = $this->allFixtureIDs('Folder');
		
		foreach($folderIDs as $folderID) {
			$folder = DataObject::get_by_id('Folder', $folderID);
			
			if(!file_exists(BASE_PATH."/$folder->Filename")) mkdir(BASE_PATH."/$folder->Filename");
		}
		
		// Create a test files for each of the fixture references
		$fileIDs = $this->allFixtureIDs('Image');
		foreach($fileIDs as $fileID) {
			$file = DataObject::get_by_id('Image', $fileID);
			$image = imagecreatetruecolor(300,300);
		
			imagepng($image, BASE_PATH."/$file->Filename");
			imagedestroy($image);
		
			$file->write();
		}
	}
 public function setUp()
 {
     parent::setUp();
     self::$originalVersionInfo = Deprecation::dump_settings();
     Deprecation::$notice_level = E_USER_NOTICE;
     Deprecation::set_enabled(true);
 }
 function setUp()
 {
     parent::setUp();
     Object::add_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
     $this->orig['domain_based_caching'] = FilesystemPublisher::$domain_based_caching;
     FilesystemPublisher::$domain_based_caching = false;
 }
 public function setUp()
 {
     parent::setUp();
     $data = array(array("Course.Title" => "Math 101", "Term" => 1), array("Course.Title" => "Tech 102", "Term" => 1), array("Course.Title" => "Geometry 722", "Term" => 1));
     $this->loader = new BetterBulkLoader("BulkLoaderRelationTest_CourseSelection");
     $this->loader->setSource(new ArrayBulkLoaderSource($data));
 }
 public function setUp()
 {
     parent::setUp();
     $this->base = dirname(__FILE__) . '/fixtures/classmanifest';
     $this->manifest = new SS_ClassManifest($this->base, false, true, false);
     $this->manifestTests = new SS_ClassManifest($this->base, true, true, false);
 }
Beispiel #28
0
 public function setUp()
 {
     if (get_class($this) == "ImageTest") {
         $this->skipTest = true;
     }
     parent::setUp();
     $this->origBackend = Image::get_backend();
     if ($this->skipTest) {
         return;
     }
     if (!file_exists(ASSETS_PATH)) {
         mkdir(ASSETS_PATH);
     }
     // Create a test folders for each of the fixture references
     $folderIDs = $this->allFixtureIDs('Folder');
     foreach ($folderIDs as $folderID) {
         $folder = DataObject::get_by_id('Folder', $folderID);
         if (!file_exists(BASE_PATH . "/{$folder->Filename}")) {
             mkdir(BASE_PATH . "/{$folder->Filename}");
         }
     }
     // Copy test images for each of the fixture references
     $imageIDs = $this->allFixtureIDs('Image');
     foreach ($imageIDs as $imageID) {
         $image = DataObject::get_by_id('Image', $imageID);
         $filePath = BASE_PATH . "/{$image->Filename}";
         $sourcePath = str_replace('assets/ImageTest/', 'framework/tests/model/testimages/', $filePath);
         if (!file_exists($filePath)) {
             if (!copy($sourcePath, $filePath)) {
                 user_error('Failed to copy test images', E_USER_ERROR);
             }
         }
     }
 }
	function setUp() {
		parent::setUp();
		
		// Log in as admin so that we don't run into permission issues.  That's not what we're
		// testing here.
		$this->logInWithPermission('ADMIN');
	}
Beispiel #30
0
	function setUp() {
		parent::setUp();
		
		$this->alternateBasePath = Director::baseFolder() . "/sapphire/tests/i18n/_fakewebroot";
		$this->alternateBaseSavePath = TEMP_FOLDER . '/i18nTextCollectorTest_webroot';
		FileSystem::makeFolder($this->alternateBaseSavePath);
		
		// SSViewer and ManifestBuilder don't support different webroots, hence we set the paths manually
		global $_CLASS_MANIFEST;
		$_CLASS_MANIFEST['i18nTestModule'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php';
		$_CLASS_MANIFEST['i18nTestModule_Addition'] = $this->alternateBasePath . '/i18ntestmodule/code/i18nTestModule.php';
		$_CLASS_MANIFEST['i18nTestModuleDecorator'] = $this->alternateBasePath . '/i18nothermodule/code/i18nTestModuleDecorator.php';
		
		global $_ALL_CLASSES;
		$_ALL_CLASSES['parents']['i18nTestModule'] = array('DataObject'=>'DataObject','Object'=>'Object');
		$_ALL_CLASSES['parents']['i18nTestModule_Addition'] = array('Object'=>'Object');
		$_ALL_CLASSES['parents']['i18nTestModuleDecorator'] = array('DataObjectDecorator'=>'DataObjectDecorator','Object'=>'Object');

		global $_TEMPLATE_MANIFEST;
		$_TEMPLATE_MANIFEST['i18nTestModule.ss'] = array(
			'main' => $this->alternateBasePath . '/i18ntestmodule/templates/i18nTestModule.ss',
			'Layout' => $this->alternateBasePath . '/i18ntestmodule/templates/Layout/i18nTestModule.ss',
		);
		$_TEMPLATE_MANIFEST['i18nTestModuleInclude.ss'] = array(
			'Includes' => $this->alternateBasePath . '/i18ntestmodule/templates/Includes/i18nTestModuleInclude.ss',
		);
		$_TEMPLATE_MANIFEST['i18nTestModule.ss'] = array(
			'main' => $this->alternateBasePath . '/i18ntestmodule/templates/i18nTestModule.ss',
			'Layout' => $this->alternateBasePath . '/i18ntestmodule/templates/Layout/i18nTestModule.ss',
		);
	}