當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vfsStreamWrapper::setRoot方法代碼示例

本文整理匯總了PHP中org\bovigo\vfs\vfsStreamWrapper::setRoot方法的典型用法代碼示例。如果您正苦於以下問題:PHP vfsStreamWrapper::setRoot方法的具體用法?PHP vfsStreamWrapper::setRoot怎麽用?PHP vfsStreamWrapper::setRoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org\bovigo\vfs\vfsStreamWrapper的用法示例。


在下文中一共展示了vfsStreamWrapper::setRoot方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Sets up the test fixture.
  *
  * @return void
  */
 public function setUp()
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('test'));
     $this->forum = 'test';
     $this->contents = new Forum_Contents(vfsStream::url('test'));
 }
開發者ID:TN03,項目名稱:forum_xh,代碼行數:12,代碼來源:ContentsTest.php

示例2: setUp

 public function setUp()
 {
     $this->rootDir = new vfsStreamDirectory('queries');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot($this->rootDir);
     $this->loader = new FilesystemQueryLoader($this->rootDir->url());
 }
開發者ID:cocur,項目名稱:nqm,代碼行數:7,代碼來源:FilesystemTest.php

示例3: discard

 /**
  * Discards VFS file system changes
  *
  * @return EcomDev_PHPUnit_Model_Fixture_Vfs
  */
 public function discard()
 {
     if ($this->_currentRoot) {
         StreamWrapper::setRoot(array_pop($this->_currentRoot));
     }
     return $this;
 }
開發者ID:tiagosampaio,項目名稱:EcomDev_PHPUnit,代碼行數:12,代碼來源:Vfs.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     vfsStreamWrapper::register();
     $this->vfs = new vfsStreamDirectory('chunks');
     vfsStreamWrapper::setRoot($this->vfs);
 }
開發者ID:watonyweng,項目名稱:flowjs-tour,代碼行數:7,代碼來源:FustyRequestTest.php

示例5: setUp

 public function setUp()
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('logs'));
     $this->key = 'Logger\\Default';
     $this->factory = new LoggerFactory();
 }
開發者ID:mhilker,項目名稱:common,代碼行數:7,代碼來源:LoggerFactoryTest.php

示例6: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->ini = new Ini();
     $this->filename = realpath(__DIR__ . "/../../../data/test.ini");
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
開發者ID:mceldeen,項目名稱:mce,代碼行數:11,代碼來源:IniTest.php

示例7: testDiscovery

 /**
  * Tests the YAML file discovery.
  */
 public function testDiscovery()
 {
     vfsStreamWrapper::register();
     $root = new vfsStreamDirectory('modules');
     vfsStreamWrapper::setRoot($root);
     $url = vfsStream::url('modules');
     mkdir($url . '/test_1');
     file_put_contents($url . '/test_1/test_1.test.yml', 'name: test');
     file_put_contents($url . '/test_1/test_2.test.yml', 'name: test');
     mkdir($url . '/test_2');
     file_put_contents($url . '/test_2/test_3.test.yml', 'name: test');
     // Write an empty YAML file.
     file_put_contents($url . '/test_2/test_4.test.yml', '');
     // Set up the directories to search.
     $directories = array('test_1' => $url . '/test_1', 'test_2' => $url . '/test_1', 'test_3' => $url . '/test_2', 'test_4' => $url . '/test_2');
     $discovery = new YamlDiscovery('test', $directories);
     $data = $discovery->findAll();
     $this->assertEquals(count($data), count($directories));
     $this->assertArrayHasKey('test_1', $data);
     $this->assertArrayHasKey('test_2', $data);
     $this->assertArrayHasKey('test_3', $data);
     $this->assertArrayHasKey('test_4', $data);
     foreach (array('test_1', 'test_2', 'test_3') as $key) {
         $this->assertArrayHasKey('name', $data[$key]);
         $this->assertEquals($data[$key]['name'], 'test');
     }
     $this->assertSame(array(), $data['test_4']);
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:31,代碼來源:YamlDiscoveryTest.php

示例8: setFileSystem

 protected function setFileSystem()
 {
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('build');
     vfsStreamWrapper::setRoot($root);
     return $root;
 }
開發者ID:ausger,項目名稱:satis,代碼行數:7,代碼來源:WebBuilderDumpTest.php

示例9: testCacheWSDLIsWorldWritable

 public function testCacheWSDLIsWorldWritable()
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('tmp'));
     $SOAP = $this->getMock('SSRS\\Soap\\NTLM', array('setCacheWSDLPermission'), array('http://'));
     $SOAP->expects($this->once())->method('setCacheWSDLPermission')->with($this->equalTo(0666));
     $SOAP->setCachePath(vfsStream::url('tmp/file.wsdl'))->cacheWSDL('$fileContents');
 }
開發者ID:caseypage,項目名稱:php-ssrs-1,代碼行數:8,代碼來源:NTLMTest.php

示例10: initSchemaManager

 /**
  * PHPUnit cannot add this to code coverage
  *
  * @codeCoverageIgnore
  *
  * @param $swaggerPath
  *
  * @throws \org\bovigo\vfs\vfsStreamException
  */
 public static function initSchemaManager($swaggerPath)
 {
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
     file_put_contents(vfsStream::url('root') . '/swagger.json', json_encode(Yaml::parse(file_get_contents($swaggerPath))));
     self::$schemaManager = new SchemaManager(vfsStream::url('root') . '/swagger.json');
     self::$document = new SwaggerDocument($swaggerPath);
 }
開發者ID:krizon,項目名稱:swagger-bundle,代碼行數:17,代碼來源:ApiTestCase.php

示例11: setUp

 public function setUp()
 {
     $this->buildDir = new vfsStreamDirectory('build');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot($this->buildDir);
     $this->filesystem = m::mock('Symfony\\Component\\Filesystem\\Filesystem');
     $this->application = new Application($this->getMockKernel());
 }
開發者ID:braincrafted,項目名稱:static-site-bundle,代碼行數:8,代碼來源:BuildCommandTest.php

示例12: setUp

 public function setUp()
 {
     vfsStreamWrapper::register();
     $root = new vfsStreamDirectory('root');
     vfsStreamWrapper::setRoot($root);
     vfsStream::copyFromFileSystem(__DIR__ . '/../package');
     $this->config = ['version' => '1.0.4', 'configFile' => vfsStream::url('root/app/code/community/Slovenian/LocalePackSl/etc/config.xml'), 'packageFile' => vfsStream::url('root/package.xml')];
 }
開發者ID:symfony-si,項目名稱:magento1-sl-si,代碼行數:8,代碼來源:PackageTest.php

示例13: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->csv = new Csv();
     $this->largeCsv = realpath(__DIR__ . "/../../../data/Large.csv");
     $this->smallCsv = realpath(__DIR__ . "/../../../data/Small.csv");
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
 }
開發者ID:mceldeen,項目名稱:mce,代碼行數:12,代碼來源:CsvTest.php

示例14: setUp

 protected function setUp()
 {
     $this->root = new vfsStreamDirectory('test');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot($this->root);
     $this->responder = new StaticHtmlFileResponder($this->root->url(), 'file');
     $this->response = new Response();
 }
開發者ID:bitexpert,項目名稱:adrenaline,代碼行數:8,代碼來源:StaticHtmlFileResponderUnitTest.php

示例15: 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 NlReader();
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('tmp');
     vfsStreamWrapper::setRoot($root);
     $this->file = vfsStream::newFile('items.csv', 0764)->withContent("73-ou-XW46\nApple\n1\na")->at($root);
 }
開發者ID:aonamrata,項目名稱:FileParser,代碼行數:12,代碼來源:NlReaderTest.php


注:本文中的org\bovigo\vfs\vfsStreamWrapper::setRoot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。