本文整理汇总了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());
}
示例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));
}
示例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'));
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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');
}
示例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');
}
示例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);
}
示例13: setUp
public function setUp()
{
vfsStreamWrapper::register();
$root = vfsStream::setup('logs');
$mockFile = vfsStream::newFile('logging_helper.log')->at($root);
$root->addChild($mockFile);
}
示例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();
}
示例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];
}