本文整理汇总了PHP中SapphireTest::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP SapphireTest::setUp方法的具体用法?PHP SapphireTest::setUp怎么用?PHP SapphireTest::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SapphireTest
的用法示例。
在下文中一共展示了SapphireTest::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
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());
}
示例2: setUp
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');
}
示例3: setUp
public function setUp()
{
parent::setUp();
if (!class_exists('FileSystemContentSource')) {
throw new Exception("You must have the filesystem connector installed to use for testing");
}
}
示例4: setUp
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();
}
示例5: setUp
public function setUp()
{
parent::setUp();
StaticPagesQueueEvent::clear();
Config::inst()->nest();
Config::inst()->update('StaticPagesQueue', 'realtime', true);
}
示例6: setUp
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();
}
示例7: setUp
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);
}
示例8: setUp
public function setUp()
{
parent::setUp();
Config::nest();
// Two restarts are allowed per job
Config::inst()->update('QueuedJobService', 'stall_threshold', 2);
}
示例9: setUp
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);
}
}
示例10: setUp
public function setUp()
{
parent::setUp();
ShopTest::setConfiguration();
$this->cart = $this->objFromFixture("Order", "cart");
$this->othercart = $this->objFromFixture("Order", "othercart");
}
示例11: setUp
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);
}
示例12: setUp
public function setUp()
{
parent::setUp();
Config::inst()->update('SSViewer', 'source_file_comments', false);
Config::inst()->update('SSViewer_FromString', 'cache_template', false);
$this->oldServer = $_SERVER;
}
示例13: setUp
public function setUp()
{
parent::setUp();
$this->ball = $this->objFromFixture("Product", "ball");
$this->mp3player = $this->objFromFixture("Product", "mp3player");
$this->redlarge = $this->objFromFixture("ProductVariation", "redlarge");
}
示例14: setUp
public function setUp()
{
// Set timezone to support timestamp->date conversion.
$this->originalTZ = date_default_timezone_get();
date_default_timezone_set('Pacific/Auckland');
parent::setUp();
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->rootDir = ASSETS_PATH . '/AssetAdapterTest';
Filesystem::makeFolder($this->rootDir);
$this->originalServer = $_SERVER;
}