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


PHP vfsStreamWrapper::register方法代码示例

本文整理汇总了PHP中vfsStreamWrapper::register方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStreamWrapper::register方法的具体用法?PHP vfsStreamWrapper::register怎么用?PHP vfsStreamWrapper::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vfsStreamWrapper的用法示例。


在下文中一共展示了vfsStreamWrapper::register方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('exampleDir'));
     $this->Translation_File_Output = new Translation_File_Output_JavaScript(vfsStream::url('exampleDir/subdir1/subdir2/test.js'));
 }
开发者ID:spalax,项目名称:zf2-translation-scanner,代码行数:10,代码来源:OutputTest.php

示例2: setUp

 public function setUp()
 {
     $this->proxyClass = $this->buildAccessibleProxy('Tx_PtExtbase_SqlGenerator_SqlGenerator');
     $this->proxy = new $this->proxyClass();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('Foo'));
 }
开发者ID:punktde,项目名称:pt_extbase,代码行数:7,代码来源:SqlGeneratorTest.php

示例3: set_up

 public function set_up()
 {
     $this->helper('directory');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
     $this->_test_dir = vfsStreamWrapper::getRoot();
 }
开发者ID:ishawge,项目名称:No-CMS,代码行数:7,代码来源:directory_helper_test.php

示例4: setUp

 public function setUp()
 {
     TestRequire::vfs($this);
     $this->sa = new SourceAnalyzer();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
 }
开发者ID:noseglid,项目名称:phpa,代码行数:7,代码来源:SATest.php

示例5: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = new F4h_TicketConverter_Data_Writer_Xml();
     $this->queue = $this->getMock('F4h_TicketConverter_Model_Queue');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
开发者ID:rebel-l,项目名称:ticketconverter,代码行数:11,代码来源:XmlTest.php

示例6: __construct

 public function __construct()
 {
     $config = new stdClass();
     $config->paths = new stdClass();
     $config->paths->docroot = null;
     $config->site = new stdClass();
     $config->site->mode = 'prod';
     $config->site->cdnPrefix = 'a';
     $config->defaults = new stdClass();
     $config->defaults->cdnPrefix = '';
     $config->defaults->mediaVersion = 'a';
     parent::__construct(array('config' => $config));
     if (class_exists('vfsStream')) {
         vfsStreamWrapper::register();
         vfsStreamWrapper::setRoot(new vfsStreamDirectory('assetDir'));
         $config->paths->docroot = vfsStream::url('assetDir');
     }
     $this->docroot = $config->paths->docroot;
     $this->cacheDir = sprintf('%s/assets/cache', $this->docroot);
     $this->assets = $this->assetsRel = array('js' => array(), 'css' => array());
     $siteMode = $config->site->mode;
     if ($siteMode === 'prod') {
         $this->mode = self::minified;
     } else {
         $this->mode = self::combined;
     }
     $this->returnAsHeader = false;
 }
开发者ID:gg1977,项目名称:frontend,代码行数:28,代码来源:AssetPipelineTest.php

示例7: setUp

 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     $this->unixStylePath = \TYPO3\FLOW3\Utility\Files::getUnixStylePath(__DIR__);
     $this->unixStylePathAndFilename = \TYPO3\FLOW3\Utility\Files::getUnixStylePath(__FILE__);
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('testDirectory'));
 }
开发者ID:nxpthx,项目名称:FLOW3,代码行数:12,代码来源:FileMonitorTest.php

示例8: testGetRoleEnvironmentData

 /**
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::__construct
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::getRoleEnvironmentData
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::setEndpoint
  * @covers WindowsAzure\ServiceRuntime\Internal\Protocol1RuntimeGoalStateClient::_ensureGoalStateRetrieved
  */
 public function testGetRoleEnvironmentData()
 {
     // Setup
     $rootDirectory = 'root';
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory($rootDirectory));
     $roleEnvironmentFileName = 'roleEnvironment';
     $roleEnvironmentFileContent = '<?xml version="1.0" encoding="utf-8"?>' . '<RoleEnvironment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema">' . '<Deployment id="id1" emulated="false" />' . '<CurrentInstance id="geophotoapp_IN_0" roleName="geophotoapp" faultDomain="0" updateDomain="0">' . '<ConfigurationSettings />' . '<LocalResources>' . '<LocalResource name="DiagnosticStore" path="somepath.DiagnosticStore" sizeInMB="4096" />' . '</LocalResources>' . '<Endpoints>' . '<Endpoint name="HttpIn" address="10.114.250.21" port="80" protocol="tcp" />' . '</Endpoints>' . '</CurrentInstance>' . '<Roles />' . '</RoleEnvironment>';
     $file = \vfsStream::newFile($roleEnvironmentFileName);
     $file->setContent($roleEnvironmentFileContent);
     \vfsStreamWrapper::getRoot()->addChild($file);
     $goalStateFileName = 'goalstate';
     $goalStateFileContent = '<?xml version="1.0" encoding="utf-8"?>' . '<GoalState xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' . 'xmlns:xsd="http://www.w3.org/2001/XMLSchema">' . '<Incarnation>1</Incarnation>' . '<ExpectedState>Started</ExpectedState>' . '<RoleEnvironmentPath>' . \vfsStream::url($rootDirectory . '/' . $roleEnvironmentFileName) . '</RoleEnvironmentPath>' . '<CurrentStateEndpoint>\\.\\pipe\\WindowsAzureRuntime.CurrentState</CurrentStateEndpoint>' . '<Deadline>9999-12-31T23:59:59.9999999</Deadline>' . '</GoalState>';
     $goalStateFileContent = dechex(strlen($goalStateFileContent)) . "\n" . $goalStateFileContent;
     $file = \vfsStream::newFile($goalStateFileName);
     $file->setContent($goalStateFileContent);
     \vfsStreamWrapper::getRoot()->addChild($file);
     // Test
     $fileInputChannel = new FileInputChannel();
     $goalStateDeserializer = new ChunkedGoalStateDeserializer();
     $roleEnvironmentDeserializer = new XmlRoleEnvironmentDataDeserializer();
     $currentStateClient = new Protocol1RuntimeCurrentStateClient(null, null);
     $runtimeGoalStateClient = new Protocol1RuntimeGoalStateClient($currentStateClient, $goalStateDeserializer, $roleEnvironmentDeserializer, $fileInputChannel);
     $runtimeGoalStateClient->setEndpoint(\vfsStream::url($rootDirectory . '/' . $goalStateFileName));
     // Test
     $this->assertNotEquals(null, $runtimeGoalStateClient->getRoleEnvironmentData());
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:33,代码来源:Protocol1RuntimeGoalStateClientTest.php

示例9: setUp

 public function setUp()
 {
     if (class_exists('vfsStream')) {
         vfsStreamWrapper::register();
         vfsStreamWrapper::setRoot(new vfsStreamDirectory('scriptsDir'));
         $this->scriptsDir = vfsStream::url('scriptsDir');
         mkdir($upgradeDir = "{$this->scriptsDir}/upgrade");
         mkdir("{$this->scriptsDir}/upgrade/readme");
         mkdir("{$this->scriptsDir}/upgrade/base");
         mkdir("{$this->scriptsDir}/upgrade/db");
         mkdir("{$this->scriptsDir}/upgrade/db/mysql");
         mkdir("{$this->scriptsDir}/upgrade/fs");
         $this->assertTrue(is_dir($upgradeDir));
     }
     $this->config = new stdClass();
     $this->config->paths = new stdClass();
     $this->config->paths->configs = $this->scriptsDir;
     $this->config->defaults = new stdClass();
     $this->config->defaults->currentCodeVersion = '1.1.1';
     $this->config->defaults->lastCodeVersion = '2.2.2';
     $this->config->site = new stdClass();
     $this->config->site->lastCodeVersion = '3.3.3';
     $params = array('config' => $this->config);
     $this->upgrade = new Upgrade($params);
 }
开发者ID:nicolargo,项目名称:frontend,代码行数:25,代码来源:UpgradeTest.php

示例10: setUp

 function setUp()
 {
     _reset_wp();
     $this->fa = new ComicPressBackendFilesystemFactory();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
开发者ID:johnbintz,项目名称:comicpress-core,代码行数:7,代码来源:ComicPressBackendFilesystemFactoryTest.php

示例11: setUp

 function setUp()
 {
     _reset_wp();
     $this->cp = new ComicPress();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
开发者ID:johnbintz,项目名称:comicpress-core,代码行数:7,代码来源:ComicPressTest.php

示例12: setUp

 function setUp()
 {
     _reset_wp();
     $this->pf = new PostFixtures();
     $_POST = array();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
开发者ID:johnbintz,项目名称:post-fixtures,代码行数:8,代码来源:PostFixturesTest.php

示例13: setUp

 /**
  * Sets up this testcase
  *
  * @return void
  */
 public function setUp()
 {
     if (!class_exists('\\vfsStreamWrapper')) {
         $this->markTestSkipped('File backend tests are not available with this phpunit version.');
     }
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:13,代码来源:FileBackendTest.php

示例14: setUp

 /**
  * @return void
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Foo'));
     $this->repository = $this->getAccessibleMock('TYPO3\\FLOW3\\I18n\\Cldr\\CldrRepository', array('dummy'));
     $this->repository->_set('cldrBasePath', 'vfs://Foo/');
     $this->dummyLocale = new \TYPO3\FLOW3\I18n\Locale('en');
 }
开发者ID:nxpthx,项目名称:FLOW3,代码行数:11,代码来源:CldrRepositoryTest.php

示例15: _getVirtualFsRoot

 /**
  * Initialize virtual filesystem
  *
  * @param string $directoryName The root of the vfs
  * @return string The created vfs' root
  */
 protected function _getVirtualFsRoot($directoryName)
 {
     //prepare vfs
     //setup vfsSW, root directory
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory($directoryName));
     return vfsStream::url($directoryName);
 }
开发者ID:erenon,项目名称:Light,代码行数:14,代码来源:PageFileMapperTest.php


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