• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP vfs\vfsStreamWrapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: tearDownCacheDir

 public function tearDownCacheDir()
 {
     vfsStreamWrapper::register();
     $cacheDir = vfsStream::url('zf2-module-test');
     if (is_dir($cacheDir)) {
         static::rmdir($cacheDir);
     }
 }
开发者ID:pnaq57,项目名称:zf2demo,代码行数:8,代码来源:AbstractControllerTestCaseTest.php


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


示例18:

 function __construct()
 {
     parent::__construct();
     vfsStreamWrapper::register();
     \Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
     $this->objectMother = new \UnitTest\Lib\ObjectMother($this);
     $this->onCreate();
 }
开发者ID:noikiy,项目名称:tools,代码行数:8,代码来源:BaseTestCase.php


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


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Config\ConfigManager类代码示例发布时间:2022-05-23
下一篇:
PHP vfs\vfsStreamDirectory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap