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


PHP vfs\vfsStreamWrapper类代码示例

本文整理汇总了PHP中org\bovigo\vfs\vfsStreamWrapper的典型用法代码示例。如果您正苦于以下问题:PHP vfsStreamWrapper类的具体用法?PHP vfsStreamWrapper怎么用?PHP vfsStreamWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: test_create_token_folder_if_it_does_not_exist

 public function test_create_token_folder_if_it_does_not_exist()
 {
     $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('tokens'), 'Folder should not exists');
     $tokenizer = $this->instantiateClass('token_filename_retrieve.token', vfsStream::url('testDir/tokens'), $this->token_content, new Filesystem());
     $tokenizer->retrieve();
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('tokens'), 'Folder should now exists even if retrieve notes file does not');
 }
开发者ID:alnutile,项目名称:token_file_creator,代码行数:7,代码来源:TokenizerModelTest.php

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

示例3: createFile

 private function createFile($filePath, $body = 'hello')
 {
     vfsStream::newFile($filePath)->at(vfsStreamWrapper::getRoot());
     $path = vfsStream::url('root/' . $filePath);
     file_put_contents($path, $body);
     return $path;
 }
开发者ID:mirobrando,项目名称:ng-phalcon,代码行数:7,代码来源:ManagementPathTest.php

示例4: setUp

 public function setUp()
 {
     vfsStreamWrapper::register();
     $root = vfsStream::setup('logs');
     $mockFile = vfsStream::newFile('logging_helper.log')->at($root);
     $root->addChild($mockFile);
 }
开发者ID:edgarsandi,项目名称:logging-helper,代码行数:7,代码来源:FactoryTest.php

示例5: testConstruct

 public function testConstruct()
 {
     // test non existent file
     $nonExistentFilePath = "non/existent/file.php";
     try {
         new ConsoleRunner($nonExistentFilePath, $this->pidFactory, []);
         $this->fail("Should not be able to create a console runner without a console file that exists");
     } catch (RunnerException $e) {
         $this->assertContains($nonExistentFilePath, $e->getMessage());
     }
     // test non executable file
     $nonExecutableFilePath = "nonExecutableFile.php";
     $nonExecutableFile = vfsStream::newFile($nonExecutableFilePath, 00);
     vfsStreamWrapper::getRoot()->addChild($nonExecutableFile);
     $nonExecutableFilePath = $this->getPath($nonExecutableFilePath);
     try {
         new ConsoleRunner($nonExecutableFilePath, $this->pidFactory, []);
         $this->fail("Should not be able to create a console runner without a console file that is executable");
     } catch (RunnerException $e) {
         $this->assertContains($nonExecutableFilePath, $e->getMessage());
     }
     // test valid file
     $consolePath = "console.php";
     $nonExecutableFile = vfsStream::newFile($consolePath, 0444);
     vfsStreamWrapper::getRoot()->addChild($nonExecutableFile);
     $consolePath = $this->getPath($consolePath);
     $runner = new ConsoleRunner($consolePath, $this->pidFactory, []);
     $this->assertAttributeEquals($consolePath, "consolePath", $runner);
 }
开发者ID:silktide,项目名称:teamster,代码行数:29,代码来源:ConsoleRunnerTest.php

示例6: setFileSystem

 protected function setFileSystem()
 {
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('build');
     vfsStreamWrapper::setRoot($root);
     return $root;
 }
开发者ID:ausger,项目名称:satis,代码行数:7,代码来源:WebBuilderDumpTest.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: setUp

 protected function setUp()
 {
     parent::setUp();
     vfsStreamWrapper::register();
     $this->vfs = new vfsStreamDirectory('chunks');
     vfsStreamWrapper::setRoot($this->vfs);
 }
开发者ID:watonyweng,项目名称:flowjs-tour,代码行数:7,代码来源:FustyRequestTest.php

示例9: setUp

 public function setUp(DiInterface $di = NULL, Config $config = NULL)
 {
     vfsStream::setup('root');
     vfsStream::newFile('file.php')->at(vfsStreamWrapper::getRoot());
     $this->file = vfsStream::url('root/file.php');
     parent::setUp($di, $config);
 }
开发者ID:mirobrando,项目名称:ng-phalcon,代码行数:7,代码来源:ServiceTest.php

示例10: getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory

 /**
  * @test
  * @expectedException \Neos\FluidAdaptor\View\Exception\InvalidTemplateResourceException
  */
 public function getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory()
 {
     vfsStreamWrapper::register();
     mkdir('vfs://MyPartials/NotAFile');
     $this->standaloneView->setPartialRootPath('vfs://MyPartials');
     $this->standaloneView->getTemplatePaths()->getPartialSource('NotAFile');
 }
开发者ID:neos,项目名称:flow-development-collection,代码行数:11,代码来源:StandaloneViewTest.php

示例11: testFactoryCreateServiceWithName

 public function testFactoryCreateServiceWithName()
 {
     $this->init(array('logger' => array($this->key => array('path' => vfsStream::url('logs/default.log')))));
     $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild('default.log'));
     $this->assertInstanceOf('Zend\\Log\\Logger', $this->factory->createServiceWithName($this->serviceLocator, $this->key, $this->key));
     $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild('default.log'));
 }
开发者ID:mhilker,项目名称:common,代码行数:7,代码来源:LoggerFactoryTest.php

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

示例13: setUp

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

示例14: passwordShouldBeAddToRsaIfPasswordPassed

 /**
  * @test
  */
 public function passwordShouldBeAddToRsaIfPasswordPassed()
 {
     vfsStream::newFile('id_rsa')->at(vfsStreamWrapper::getRoot());
     $authentication = new Rsa('root', vfsStream::url('root/id_rsa'), 'password');
     /** @var \Crypt_RSA $rsa */
     $rsa = $authentication->getAuthentication();
     $this->assertEquals('password', $rsa->password);
 }
开发者ID:sayiho,项目名称:Jumper,代码行数:11,代码来源:RsaTest.php

示例15: vfsPath

 /**
  * Retrieves the virtual file system path
  *
  * @param string $path The path relative to the root folder
  *
  * @return string
  */
 protected function vfsPath($path = '')
 {
     $root = vfsStreamWrapper::getRoot()->getName();
     if (empty($path)) {
         return vfsStream::url($root);
     }
     return vfsStream::url($root . '/' . $path);
 }
开发者ID:novuso,项目名称:system,代码行数:15,代码来源:VirtualFileSystem.php


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