當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。