当前位置: 首页>>代码示例>>PHP>>正文


PHP SapphireTest::setUp方法代码示例

本文整理汇总了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());
	}
开发者ID:redema,项目名称:sapphire,代码行数:7,代码来源:GridFieldDeleteActionTest.php

示例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');
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:7,代码来源:AggregateTest.php

示例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");
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-external-content,代码行数:7,代码来源:ExternalContentTest.php

示例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();
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:7,代码来源:RestfulServiceTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     StaticPagesQueueEvent::clear();
     Config::inst()->nest();
     Config::inst()->update('StaticPagesQueue', 'realtime', true);
 }
开发者ID:spark-green,项目名称:silverstripe-staticpublishqueue,代码行数:7,代码来源:StaticPagesQueueEventTest.php

示例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();
 }
开发者ID:assertchris,项目名称:silverstripe-framework,代码行数:25,代码来源:AssetControlExtensionTest.php

示例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);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-staticpublisher,代码行数:7,代码来源:FilesystemPublisherTest.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     Config::nest();
     // Two restarts are allowed per job
     Config::inst()->update('QueuedJobService', 'stall_threshold', 2);
 }
开发者ID:tim-lar,项目名称:silverstripe-queuedjobs,代码行数:7,代码来源:QueuedJobsTest.php

示例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);
     }
 }
开发者ID:helpfulrobot,项目名称:flashbackzoo-silverstripe-charts,代码行数:27,代码来源:ChartsTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     ShopTest::setConfiguration();
     $this->cart = $this->objFromFixture("Order", "cart");
     $this->othercart = $this->objFromFixture("Order", "othercart");
 }
开发者ID:helpfulrobot,项目名称:silvershop-discounts,代码行数:7,代码来源:GroupDiscountConstraintTest.php

示例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);
	}
开发者ID:redema,项目名称:sapphire,代码行数:7,代码来源:GridFieldExportButtonTest.php

示例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;
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:7,代码来源:SSViewerTest.php

示例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");
 }
开发者ID:helpfulrobot,项目名称:silvershop-core,代码行数:7,代码来源:ProductVariationTest.php

示例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();
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:7,代码来源:DateTest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $this->rootDir = ASSETS_PATH . '/AssetAdapterTest';
     Filesystem::makeFolder($this->rootDir);
     $this->originalServer = $_SERVER;
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:7,代码来源:AssetAdapterTest.php


注:本文中的SapphireTest::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。