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

PHP vfs\vfsStreamDirectory类代码示例

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

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



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

示例1: createVendorDirectory

 protected function createVendorDirectory(vfsStreamDirectory $rootDirectory)
 {
     $directory = new vfsStreamDirectory('vendor');
     $rootDirectory->addChild($directory);
     $directory->addChild(new vfsStreamFile('autoload.php'));
     $subDirectory = new vfsStreamDirectory('composer');
     $directory->addChild($subDirectory);
     $subDirectory->addChild(new vfsStreamFile('autoload_classmap.php'));
     $subDirectory->addChild(new vfsStreamFile('autoload_namespaces.php'));
     $subDirectory->addChild(new vfsStreamFile('autoload_psr4.php'));
     $subDirectory->addChild(new vfsStreamFile('autoload_real.php'));
     $subDirectory->addChild(new vfsStreamFile('ClassLoader.php'));
     $subDirectory->addChild(new vfsStreamFile('installed_paths.php'));
     $subDirectory->addChild(new vfsStreamFile('installed.json'));
     $subDirectory = new vfsStreamDirectory('psr');
     $directory->addChild($subDirectory);
     $secondLevelSubDirectory = new vfsStreamDirectory('log');
     $subDirectory->addChild($secondLevelSubDirectory);
     $secondLevelSubDirectory->addChild(new vfsStreamFile('.gitignore'));
     $secondLevelSubDirectory->addChild(new vfsStreamFile('composer.json'));
     $secondLevelSubDirectory->addChild(new vfsStreamFile('LICENSE'));
     $secondLevelSubDirectory->addChild(new vfsStreamFile('README.md'));
     $thirdLevelSubDirectory = new vfsStreamDirectory('Psr');
     $secondLevelSubDirectory->addChild($thirdLevelSubDirectory);
     $fourthLevelSubDirectory = new vfsStreamDirectory('Log');
     $thirdLevelSubDirectory->addChild($fourthLevelSubDirectory);
     $fourthLevelSubDirectory->addChild(new vfsStreamFile('InvalidArgumentException.php'));
     $fourthLevelSubDirectory->addChild(new vfsStreamFile('LoggerInterface.php'));
     $fourthLevelSubDirectory->addChild(new vfsStreamFile('LogLevel.php'));
     $fourthLevelSubDirectory->addChild(new vfsStreamFile('NullLogger.php'));
 }
开发者ID:jmfontaine,项目名称:projectlint,代码行数:31,代码来源:ProjectLintTestCase.php


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


示例3: testIsFile

 public function testIsFile()
 {
     $this->root->addChild(new vfsStreamDirectory('assets'));
     $dir = $this->root->getChild('assets');
     $file = vfsStream::newFile('foo.txt')->withContent('foo')->at($this->root);
     $this->assertFalse($this->trait->isFile($dir->url()));
     $this->assertTrue($this->trait->isFile($file->url()));
 }
开发者ID:viserio,项目名称:filesystem,代码行数:8,代码来源:FilesystemHelperTraitTest.php


示例4: setUp

 protected function setUp()
 {
     $file = vfsStream::newFile('template');
     $this->fileSystem = vfsStream::setup();
     $this->fileSystem->addChild($file);
     $this->filePath = $file->url();
 }
开发者ID:bazzline,项目名称:php_component_template,代码行数:7,代码来源:FileBasedTemplateTest.php


示例5: testWriteIsWritingYamlIntoFile

 /**
  * @depends testInstanceOf
  */
 public function testWriteIsWritingYamlIntoFile()
 {
     $yamlWriterProvider = new YamlWriterProvider($this->mockWriter);
     $this->mockWriter->expects($this->once())->method('dump')->with(array('result' => false))->willReturn('result: false');
     $yamlWriterProvider->write(vfsStream::url('settings/config.yml'), array('result' => false));
     $this->assertTrue($this->root->hasChild('settings/config.yml'));
 }
开发者ID:destebang,项目名称:taskreporter-1,代码行数:10,代码来源:YamlWriterProviderTest.php


示例6: shouldUpdateVersionInEmConf

 /**
  * @test
  */
 public function shouldUpdateVersionInEmConf()
 {
     $service = new EmConfService($this->root->url(), 'extension_manager');
     $service->updateVersion('47.11.4711');
     $service->write();
     $this->assertRegExp('~\'version\' => \'47\\.11\\.4711\'~', $this->emConf->getContent());
 }
开发者ID:AOEpeople,项目名称:TYPO3-CLI-Tools,代码行数:10,代码来源:EmConfServiceTest.php


示例7: testConstruct

 public function testConstruct()
 {
     $this->assertFileExists($this->configDir->url() . DIRECTORY_SEPARATOR . 'test');
     unset($configHandler);
     new ConfigFileHandler('test-process', $this->configDirPath);
     $this->assertEquals(['root' => ['test' => []]], vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
开发者ID:HEXA-UA,项目名称:supervisor-manager,代码行数:7,代码来源:ConfigFileHandlerTest.php


示例8: getQueryShouldReturnQuery

 /**
  * @test
  *
  * @covers Cocur\NQM\QueryLoader\FilesystemQueryLoader::getQuery()
  * @covers Cocur\NQM\QueryLoader\FilesystemQueryLoader::getQueryFilename()
  */
 public function getQueryShouldReturnQuery()
 {
     $file = new vfsStreamFile('foobar.sql');
     $file->setContent('SELECT * FROM table;');
     $this->rootDir->addChild($file);
     $this->assertEquals('SELECT * FROM table;', $this->loader->getQuery('foobar'));
 }
开发者ID:cocur,项目名称:nqm,代码行数:13,代码来源:FilesystemTest.php


示例9: testLoadFileNotReadable

 /**
  * @expectedException \EBT\ConfigLoader\Exception\InvalidArgumentException
  * @expectedExceptionMessage not readable
  */
 public function testLoadFileNotReadable()
 {
     $this->root->addChild(vfsStream::newFile('file1'));
     // make sure is not readable
     $this->root->getChild('file1')->chown('testuser')->chgrp('testuser')->chmod(0750);
     (new JsonFileLoader())->load(vfsStream::url('test/file1'));
 }
开发者ID:ebidtech,项目名称:config-loader,代码行数:11,代码来源:JsonFileLoaderTest.php


示例10: testNonExistent

 public function testNonExistent()
 {
     $url = $this->_root->url() . '/test';
     $validator = new DirectoryWritable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(array(DirectoryWritable::DIRECTORY => "'{$url}' ist kein Verzeichnis oder nicht zugänglich"), $validator->getMessages());
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:7,代码来源:DirectoryWritableTest.php


示例11: testNonExistent

 public function testNonExistent()
 {
     $url = $this->_root->url() . '/test';
     $validator = new FileReadable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(array(FileReadable::FILE => "'{$url}' ist keine Datei oder nicht zugänglich"), $validator->getMessages());
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:7,代码来源:FileReadableTest.php


示例12: getImageFolder

 function getImageFolder()
 {
     $this->vfsRoot = vfsStream::setup('root');
     mkdir(vfsStream::url('root') . '/images');
     vfsStream::copyFromFileSystem(__DIR__ . '/Fixtures/source', $this->vfsRoot->getChild('images'));
     return vfsStream::url('root');
 }
开发者ID:asins,项目名称:imagecache,代码行数:7,代码来源:autoload.php


示例13:

 function it_should_do_multiple_to_registry()
 {
     $this->pushImage(vfsStream::url('system/docker/build/buildscript.sh'), 'registry/library/ubuntu:14.04');
     $this->pushImage(vfsStream::url('system/docker/build/buildscript.sh'), 'registry/library/ubuntu:15.04');
     $buildScript = $this->root->getChild('docker/build/buildscript.sh');
     \PHPUnit_Framework_Assert::assertEquals("#!/usr/bin/env bash\ndocker push registry/library/ubuntu:14.04 \\\n&& docker push registry/library/ubuntu:15.04", $buildScript->getContent());
 }
开发者ID:madkom,项目名称:docker-image-builder,代码行数:7,代码来源:AssistantSpec.php


示例14: testShouldThrowExceptionWhenDeletionNotPermitted

 /**
  * @expectedException RuntimeException
  */
 public function testShouldThrowExceptionWhenDeletionNotPermitted()
 {
     $this->root->chmod(0555);
     $this->root->getChild('testfile2')->chmod(0555);
     $localDelete = new DefaultDelete($this->root->url() . '/testfile2');
     $localDelete->execute();
 }
开发者ID:fashionforhome,项目名称:s3fileshifter,代码行数:10,代码来源:DefaultDeleteTest.php


示例15: testFustyRequest_ValidateUpload

 /**
  */
 public function testFustyRequest_ValidateUpload()
 {
     //// Setup test
     $firstChunk = vfsStream::newFile('temp_file');
     $firstChunk->setContent('1234567890');
     $this->vfs->addChild($firstChunk);
     $fileInfo = new \ArrayObject(array('size' => 10, 'error' => UPLOAD_ERR_OK, 'tmp_name' => $firstChunk->url()));
     $request = new \ArrayObject(array('flowIdentifier' => '13632-prettifyjs', 'flowFilename' => 'prettify.js', 'flowRelativePath' => 'home/prettify.js'));
     $fustyRequest = new FustyRequest($request, $fileInfo);
     $config = new Config();
     $config->setTempDir($this->vfs->url());
     /** @var File $file */
     $file = $this->getMock('Flow\\File', array('_move_uploaded_file'), array($config, $fustyRequest));
     /** @noinspection PhpUndefinedMethodInspection */
     $file->expects($this->once())->method('_move_uploaded_file')->will($this->returnCallback(function ($filename, $destination) {
         return rename($filename, $destination);
     }));
     //// Actual test
     $this->assertTrue($file->validateChunk());
     $this->assertFalse($file->validateFile());
     $this->assertTrue($file->saveChunk());
     $this->assertTrue($file->validateFile());
     $path = $this->vfs->url() . DIRECTORY_SEPARATOR . 'new';
     $this->assertTrue($file->save($path));
     $this->assertEquals(10, filesize($path));
 }
开发者ID:watonyweng,项目名称:flowjs-tour,代码行数:28,代码来源:FustyRequestTest.php


示例16: testCreate_WhenPatternHasLastOnFile_ThrowsException

 public function testCreate_WhenPatternHasLastOnFile_ThrowsException()
 {
     vfsStream::newFile('file.csv')->at($this->root);
     $pathToFile = $this->root->url() . '/file.csv';
     $this->setExpectedException('\\InvalidArgumentException');
     $this->getFileNameGenerator($pathToFile . ':last')->getGeneratedFileName();
 }
开发者ID:nikoms,项目名称:phpunit-fail-lover,代码行数:7,代码来源:FileNameGeneratorTest.php


示例17: setUp

 /**
  * {@inheritDoc}
  */
 protected function setUp()
 {
     $this->root = vfsStream::setup();
     $this->root->addChild(new vfsStreamFile('1.png'));
     $this->root->addChild(new vfsStreamFile('2.jpg'));
     $this->root->addChild(new vfsStreamFile('3.jpeg'));
 }
开发者ID:cotapreco,项目名称:captcha,代码行数:10,代码来源:FilesystemImageCaptchaTest.php


示例18: testSavingConfig

 public function testSavingConfig()
 {
     $this->object->setGeneratorDirectory('generator/test/dir');
     $this->assertTrue($this->filesystem->hasChild('.phpteda'));
     $actualConfiguration = unserialize($this->filesystem->getChild('.phpteda')->getContent());
     $expectedConfiguration = array('GeneratorDirectory' => 'generator/test/dir');
     $this->assertEquals($expectedConfiguration, $actualConfiguration);
 }
开发者ID:jenswiese,项目名称:phpteda,代码行数:8,代码来源:ConfigTest.php


示例19: testForReadingWithOptionalKeyParameterConfigFile

 public function testForReadingWithOptionalKeyParameterConfigFile()
 {
     $configFile = vfsStream::newFile('config.inc.php');
     $configFile->setContent('<?php return ["primary-key"=>["test-key"=>"test-value"]];');
     $this->root->addChild($configFile);
     $configFileReading = new ConfigFileReader($this->root->getChild('config.inc.php')->url());
     $this->assertEquals(['test-key' => 'test-value'], $configFileReading->getConfiguration('primary-key'));
 }
开发者ID:spalax,项目名称:zoho-books-al,代码行数:8,代码来源:ConfigFileReaderTest.php


示例20: testOutputDirNotFound

 public function testOutputDirNotFound()
 {
     $dir = $this->output_dir->url('thumbs');
     $service = new ImageService($this->imanee, $this->source_dir, $dir . '/test', new Filesystem());
     // test a valid resource
     $thumbnail = $service->thumbnail('valid.jpg', 100, 100, false);
     $this->assertContains('-100x100.jpeg', $thumbnail);
 }
开发者ID:helios-ag,项目名称:icelus,代码行数:8,代码来源:ImageServiceTest.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP vfs\vfsStreamWrapper类代码示例发布时间:2022-05-23
下一篇:
PHP vfs\vfsStream类代码示例发布时间: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