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


PHP vfsStreamWrapper::getRoot方法代码示例

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


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

示例1: 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

示例2: testDirectoryIsCreated

 /**
  * test that the directory is created
  */
 public function testDirectoryIsCreated()
 {
     $example = new Example('id');
     $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('id'));
     $example->setDirectory(vfsStream::url('exampleDir'));
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('id'));
 }
开发者ID:pago,项目名称:pantr,代码行数:10,代码来源:ExampleTestCaseWithVfsStream.php

示例3: testGenerateTest

 /**
  * @covers Generator::generate_test
  */
 function testGenerateTest()
 {
     mkdir(vfsStream::url('root/test/unit'), 0777, true);
     file_put_contents(vfsStream::url('root/template/unit_test.tmpl'), '{class_name}');
     Generator::generate_test('unit', 'Unit');
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('test/unit/UnitTest.php'));
     $this->assertEquals("Unit", file_get_contents(vfsStream::url('test/unit/UnitTest.php')));
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:11,代码来源:GeneratorTest.php

示例4: setUp

 function setUp()
 {
     TestRequire::vfs($this);
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
     $this->fsroot = vfsStreamWrapper::getRoot();
     $this->ua = new UnitAnalyzer();
 }
开发者ID:noseglid,项目名称:phpa,代码行数:8,代码来源:UATest.php

示例5: testScriptExistsAndFails

 function testScriptExistsAndFails()
 {
     vfsStream::newFile('script')->at(vfsStreamWrapper::getRoot());
     $script_runner = new TryLib_Precheck_ScriptRunner(vfsStream::url('testDir/script'));
     $this->mock_cmd_runner->expects($this->once())->method('run')->with('vfs://testDir/script', false, true)->will($this->returnValue(255));
     $this->mock_cmd_runner->expects($this->once())->method('terminate')->with('Failed running pre-check script vfs://testDir/script');
     $script_runner->check($this->mock_cmd_runner, 'repoPath', 'origin/master');
 }
开发者ID:seanly,项目名称:TryLib,代码行数:8,代码来源:ScriptRunnerTest.php

示例6: setUp

 protected function setUp()
 {
     TestRequire::vfs($this);
     $this->fa = new FrequencyAnalyzer();
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
     $this->fs = vfsStreamWrapper::getRoot();
 }
开发者ID:noseglid,项目名称:phpa,代码行数:8,代码来源:FATest.php

示例7: setUp

 /**
  * Setup
  */
 protected function setUp()
 {
     if ($this->isVsfStreamInstalled()) {
         vfsStream::setup();
         $this->setTestDirectory(vfsStream::newDirectory('tests')->at(vfsStreamWrapper::getRoot()));
         define('CLIENT_DATA_DIR', vfsStream::url('root/tests'));
     }
     parent::setUp();
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:ilBcryptPasswordEncoderTest.php

示例8: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     vfsStream::setup('exampleDir');
     $file = vfsStream::newFile('test1.php');
     vfsStreamWrapper::getRoot()->addChild($file);
     $file->setContent('__' . '("test1"); __' . '(\'test2\')');
     $this->Translation_File_Source = new Translation_File_Source(vfsStream::url('exampleDir/test1.php'));
 }
开发者ID:spalax,项目名称:zf2-translation-scanner,代码行数:12,代码来源:SourceTest.php

示例9: testExtractSource

 /**
  * @dataProvider extractSource_dp
  */
 public function testExtractSource($units, $file_content, $expected)
 {
     $f = vfsStream::newFile('file.php', 0664);
     $f->withContent($file_content);
     vfsStreamWrapper::getRoot()->addChild($f);
     $this->sa->extractSource($units[0]);
     $this->assertEquals(explode("\n", $expected['src']), explode("\n", $units[0]['src']));
     $this->assertEquals(explode("\n", $expected['src_strip']), explode("\n", $units[0]['src_strip']));
     $this->assertEquals(explode("\n", $expected['sloc']), explode("\n", $units[0]['sloc']));
     $this->assertEquals(explode("\n", $expected['err']), explode("\n", $units[0]['err']));
 }
开发者ID:noseglid,项目名称:phpa,代码行数:14,代码来源:SATest.php

示例10: set_up

 function set_up()
 {
     $obj = new stdClass();
     $obj->upload = new Mock_Libraries_Upload();
     $obj->security = new Mock_Core_Security();
     $obj->lang = new Mock_Core_Lang();
     $this->ci_instance($obj);
     $this->upload = $obj->upload;
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('testDir'));
     $this->_test_dir = vfsStreamWrapper::getRoot();
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:12,代码来源:Upload_test.php

示例11: setUp

 protected function setUp()
 {
     global $xml_file_data;
     TestRequire::vfs($this);
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('r'));
     $this->fs = vfsStreamWrapper::getRoot();
     $f = new vfsStreamFile('file.xml', 0664);
     $f->withContent($xml_file_data);
     $this->fs->addChild($f);
     $this->xa = new XMLAnalyzer(vfsStream::url('file.xml'));
 }
开发者ID:noseglid,项目名称:phpa,代码行数:12,代码来源:XMLAnalyzerTest.php

示例12: newFile

 public static function newFile($contents, $fileName = null, $root = null)
 {
     $root = is_null($root) ? 'root' : $root;
     $fileName = is_null($fileName) ? 'test.txt' : $fileName;
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory($root));
     $file = \vfsStream::newFile($fileName);
     $file->setContent($contents);
     \vfsStreamWrapper::getRoot()->addChild($file);
     $virtualPath = \vfsStream::url($root . '/' . $fileName);
     return $virtualPath;
 }
开发者ID:jdruid,项目名称:Microsoft-Azure-PHP-SDK-Storage,代码行数:12,代码来源:VirtualFileSystem.php

示例13: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     vfsStream::setup('exampleDir');
     $dir = vfsStream::newDirectory('subDir1');
     vfsStreamWrapper::getRoot()->addChild($dir);
     vfsStreamWrapper::getRoot()->addChild(vfsStream::newFile('test1.php'));
     $dir->addChild(vfsStream::newFile('test2.php'));
     $dir->addChild(vfsStream::newFile('test3.js'));
     $dir->addChild(vfsStream::newFile('test4.xml'));
     $extentions = array('php' => array('PHP'));
     $this->Translation_Collector_Source_Files = new Translation_Collector_Source_Files(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(vfsStream::url('exampleDir'))), $extentions);
 }
开发者ID:spalax,项目名称:zf2-translation-scanner,代码行数:16,代码来源:FilesTest.php

示例14: initializeObjectRemovesALockFileIfItsOlderThanTheMaximumTime

 /**
  * @test
  * @author Robert Lemke <robert@typo3.org>
  */
 public function initializeObjectRemovesALockFileIfItsOlderThanTheMaximumTime()
 {
     $temporaryDirectoryUrl = \vfsStream::url('TestDirectory') . '/';
     file_put_contents($temporaryDirectoryUrl . 'FLOW3.lock', '');
     \vfsStreamWrapper::getRoot()->getChild('FLOW3.lock')->setFilemtime(time() - \F3\FLOW3\Core\LockManager::LOCKFILE_MAXIMUM_AGE - 2);
     $mockEnvironment = $this->getMock('F3\\FLOW3\\Utility\\Environment');
     $mockEnvironment->expects($this->once())->method('getPathToTemporaryDirectory')->will($this->returnValue($temporaryDirectoryUrl));
     $lockManager = new \F3\FLOW3\Core\LockManager();
     $lockManager->injectEnvironment($mockEnvironment);
     $lockManager->initializeObject();
     $this->assertFalse($lockManager->isSiteLocked());
     $this->assertFalse(file_exists($temporaryDirectoryUrl . 'FLOW3.lock'));
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:17,代码来源:LockManagerTest.php

示例15: __construct

 /**
  * Since we use paths to load up models, views, etc, we need the ability to
  * mock up the file system so when core tests are run, we aren't mucking
  * in the application directory.  this will give finer grained control over
  * these tests.  So yeah, while this looks odd, I need to overwrite protected
  * class vars in the loader.  So here we go...
  *
  * @covers CI_Loader::__construct()
  */
 public function __construct()
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('application'));
     $this->models_dir = vfsStream::newDirectory('models')->at(vfsStreamWrapper::getRoot());
     $this->libs_dir = vfsStream::newDirectory('libraries')->at(vfsStreamWrapper::getRoot());
     $this->helpers_dir = vfsStream::newDirectory('helpers')->at(vfsStreamWrapper::getRoot());
     $this->views_dir = vfsStream::newDirectory('views')->at(vfsStreamWrapper::getRoot());
     $this->_ci_ob_level = ob_get_level();
     $this->_ci_library_paths = array(vfsStream::url('application') . '/', BASEPATH);
     $this->_ci_helper_paths = array(vfsStream::url('application') . '/', BASEPATH);
     $this->_ci_model_paths = array(vfsStream::url('application') . '/');
     $this->_ci_view_paths = array(vfsStream::url('application') . '/views/' => TRUE);
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:23,代码来源:loader.php


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