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


PHP vfsStream::setup方法代码示例

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


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

示例1: testGetTranslations_shouldReturnEmptyArray

 public function testGetTranslations_shouldReturnEmptyArray()
 {
     $root = vfsStream::setup('root');
     $root->addChild(new vfsStreamFile('language.php'));
     $obj = new Language_File(vfsStream::url('root/language.php'));
     $this->assertEquals(array(), $obj->getTranslations());
 }
开发者ID:jkimdon,项目名称:cohomeals,代码行数:7,代码来源:ParseFileTest.php

示例2: testLoadUncovered

 /**
  * We ignore items that are not covered by the map.
  */
 public function testLoadUncovered()
 {
     vfsStream::setup('StaticMapTestLoadUncovered', null, ['a.php' => '<?php']);
     $object = new StaticMap(['A' => vfsStream::url('a.php'), 'B' => vfsStream::url('Covered.php')]);
     $object->load('StaticMapTestLoadUncoveredC_XYZ');
     $this->assertFalse(class_exists('StaticMapTestLoadUncoveredC_XYZ', false));
 }
开发者ID:evoke-php,项目名称:evoke-php,代码行数:10,代码来源:StaticMapTest.php

示例3: visitRecursiveDirectoryStructure

 /**
  * @test
  */
 public function visitRecursiveDirectoryStructure()
 {
     $root = vfsStream::setup('root', null, array('test' => array('foo' => array('test.txt' => 'hello'), 'baz.txt' => 'world'), 'foo.txt' => ''));
     $printVisitor = new vfsStreamPrintVisitor(fopen('vfs://root/foo.txt', 'wb'));
     $this->assertSame($printVisitor, $printVisitor->visitDirectory($root));
     $this->assertEquals("- root\n  - test\n    - foo\n      - test.txt\n    - baz.txt\n  - foo.txt\n", file_get_contents('vfs://root/foo.txt'));
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:10,代码来源:vfsStreamPrintVisitorTestCase.php

示例4: setUp

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

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

示例6: setUp

 /**
  * set up test environment
  */
 public function setUp()
 {
     $root = vfsStream::setup();
     $this->file = vfsStream::newFile('foo.txt')->withContent("bar\nbaz")->at($root);
     $this->underlyingStream = fopen($this->file->url(), 'rb+');
     $this->stream = new Stream($this->underlyingStream);
 }
开发者ID:stubbles,项目名称:stubbles-peer,代码行数:10,代码来源:StreamTest.php

示例7: testAnsibleCommandNotExecutableException

 /**
  * @expectedException \ErrorException
  * @covers \Asm\Ansible\Ansible::checkCommand
  * @covers \Asm\Ansible\Ansible::checkDir
  * @covers \Asm\Ansible\Ansible::__construct
  */
 public function testAnsibleCommandNotExecutableException()
 {
     $vfs = vfsStream::setup('/tmp');
     $ansiblePlaybook = vfsStream::newFile('ansible-playbook', 600)->at($vfs);
     $ansibleGalaxy = vfsStream::newFile('ansible-galaxy', 444)->at($vfs);
     $ansible = new Ansible($this->getProjectUri(), $ansiblePlaybook->url(), $ansibleGalaxy->url());
 }
开发者ID:Kron0S,项目名称:php-ansible,代码行数:13,代码来源:AnsibleTest.php

示例8: setUp

 /**
  * Setup the test
  */
 public function setUp()
 {
     vfsStream::setup('root', null, array('test' => 'testing'));
     $this->file = vfsStream::url('root/test');
     $this->properties = $this->getMock('\\Pants\\Property\\Properties');
     $this->task = new Copy($this->properties);
 }
开发者ID:toxygene,项目名称:pants,代码行数:10,代码来源:CopyTest.php

示例9: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->dir = vfsStream::setup();
     $dir = $this->dir;
     $tempDir = vfsStream::url($dir->getName()) . '/';
     $this->media = $this->getMock('\\Oryzone\\MediaStorage\\Model\\MediaInterface');
     $this->media->expects($this->any())->method('getContext')->will($this->returnValue('default'));
     $this->media->expects($this->any())->method('getName')->will($this->returnValue('sample'));
     $this->media->expects($this->any())->method('getContent')->will($this->returnValue('http://vimeo.com/56974716'));
     $this->media->expects($this->any())->method('getMetaValue')->will($this->returnValueMap(array(array('id', null, '56974716'))));
     $this->variant = $this->getMock('\\Oryzone\\MediaStorage\\Variant\\VariantInterface');
     $this->variant->expects($this->any())->method('getName')->will($this->returnValue('default'));
     $this->variant->expects($this->any())->method('getOptions')->will($this->returnValue(array('width' => 50, 'height' => 30, 'resize' => 'stretch')));
     $this->variant->expects($this->any())->method('getMetaValue')->will($this->returnValueMap(array(array('width', null, 50), array('height', null, 30))));
     $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
     $image->expects($this->any())->method('save')->will($this->returnCallback(function ($destFile) use($dir) {
         $temp = vfsStream::newFile(basename($destFile));
         $dir->addChild($temp);
         return true;
     }));
     $imagine = $this->getMock('\\Imagine\\Image\\ImagineInterface');
     $imagine->expects($this->any())->method('open')->will($this->returnValue($image));
     $downloader = $this->getMock('\\Oryzone\\MediaStorage\\Downloader\\DownloaderInterface');
     $downloader->expects($this->any())->method('download')->will($this->returnCallback(function ($url, $destination) use($dir) {
         $temp = vfsStream::newFile(basename($destination));
         $temp->setContent(file_get_contents(__DIR__ . '/../fixtures/images/sample.jpg'));
         $dir->addChild($temp);
         return true;
     }));
     $videoService = $this->getMock('\\Oryzone\\MediaStorage\\Integration\\Video\\VideoServiceInterface');
     $this->provider = new VimeoProvider($tempDir, $imagine, $videoService, $downloader);
 }
开发者ID:jmcclell,项目名称:OryzoneMediaStorage,代码行数:36,代码来源:VimeoProviderTest.php

示例10: setUp

 /**
  * Sets up the test suite
  *
  * @return void
  */
 public function setUp()
 {
     $this->translator = m::mock('phpDocumentor\\Translator\\Translator');
     $this->checkStyle = new CheckStyle();
     $this->checkStyle->setTranslator($this->translator);
     $this->fs = vfsStream::setup('CheckStyleTest');
 }
开发者ID:bbonnesoeur,项目名称:phpDocumentor2,代码行数:12,代码来源:CheckStyleTest.php

示例11: setUp

 public function setUp()
 {
     $this->pubkeyName = 'tmp/public.key';
     $this->root = vfsStream::setup('tmp');
     $this->pubkeyStream = vfsStream::url($this->pubkeyName);
     $this->storage = new EncryptedFilesystemStorage('satoshi');
 }
开发者ID:Invision70,项目名称:php-bitpay-client,代码行数:7,代码来源:EncryptedFilesystemStorageTest.php

示例12: setUp

 /**
  */
 public function setUp()
 {
     ComposerUtility::flushCaches();
     vfsStream::setup('Packages');
     $this->mockPackageManager = $this->getMockBuilder(\Neos\Flow\Package\PackageManager::class)->disableOriginalConstructor()->getMock();
     ObjectAccess::setProperty($this->mockPackageManager, 'composerManifestData', array(), true);
 }
开发者ID:neos,项目名称:flow-development-collection,代码行数:9,代码来源:PackageTest.php

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

示例14: setUp

 public function setUp()
 {
     $this->stream = vfsStream::setup('root', 0777, self::$structure);
     Application::register('FileSystem', \Core\FileSystem\FileSystem::class);
     Application::register('Cache', \Core\Cache\FileCache::class)->setArguments(['FileSystem', vfsStream::url('root/cache')]);
     parent::setUp();
 }
开发者ID:core-framework,项目名称:core,代码行数:7,代码来源:FileCacheTest.php

示例15: setUp

 public function setUp()
 {
     $this->projectRoot = vfsStream::setup('project');
     $this->discovery = new ConfigDiscovery();
     $this->allTypes = new Collection([InjectorInterface::TYPE_CONFIG_PROVIDER, InjectorInterface::TYPE_COMPONENT, InjectorInterface::TYPE_MODULE]);
     $this->injectorTypes = [Injector\ApplicationConfigInjector::class, Injector\ConfigInjectorChain::class, Injector\ExpressiveConfigInjector::class, Injector\ModulesConfigInjector::class];
 }
开发者ID:zendframework,项目名称:zend-component-installer,代码行数:7,代码来源:ConfigDiscoveryTest.php


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