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


PHP vfsStream::newDirectory方法代码示例

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


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

示例1: visitDirectoryWritesDirectoryNameToStream

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

示例2: testGenerateUnixRandomThrowsExceptionWhenRandomEmpty

 /**
  * @expectedException        \RuntimeException
  * @expectedExceptionMessage returned an empty value
  */
 public function testGenerateUnixRandomThrowsExceptionWhenRandomEmpty()
 {
     vfsStream::setup('root');
     vfsStream::newDirectory('dev')->at(vfsStreamWrapper::getRoot());
     vfsStream::newFile('urandom')->at(vfsStreamWrapper::getRoot()->getChild('dev'));
     $this->_stringGenerator->generateFromUnixRandom(10, vfsStream::url('root') . '/dev/urandom');
 }
开发者ID:mothership-ec,项目名称:cog,代码行数:11,代码来源:StringGeneratorTest.php

示例3: testDirectoryNonReadable

 public function testDirectoryNonReadable()
 {
     $url = vfsStream::newDirectory('test', 00)->at($this->_root)->url();
     $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

示例4: setUp

 protected function setUp()
 {
     $this->basePath = vfsStream::setup();
     $this->basePath->addChild(vfsStream::newDirectory('project'));
     $this->basePath->addChild(vfsStream::newDirectory('hooks'));
     $this->basePath->addChild(vfsStream::newDirectory('.git/hooks'));
 }
开发者ID:bitban,项目名称:php-code-quality-tools,代码行数:7,代码来源:HookManagerTest.php

示例5: setFileSystem

 protected function setFileSystem()
 {
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('build');
     vfsStreamWrapper::setRoot($root);
     return $root;
 }
开发者ID:ausger,项目名称:satis,代码行数:7,代码来源:WebBuilderDumpTest.php

示例6: testVirtualizeCanAcceptVfsContentInstances

 public function testVirtualizeCanAcceptVfsContentInstances()
 {
     $this->virtualSystem->virtualize(['test', vfsStream::newFile('test2'), vfsStream::newDirectory('testDir')]);
     $this->assertEquals(3, $this->virtualSystem->getFileCount());
     $this->assertInstanceOf(vfsStreamDirectory::class, $this->virtualSystem->getFileAtIndex(2));
     $this->assertInstanceOf(vfsStreamFile::class, $this->virtualSystem->getFileAtIndex(1));
 }
开发者ID:newup,项目名称:core,代码行数:7,代码来源:FilesystemVirtualizationTest.php

示例7: testInputFilterSaveValidDir

 public function testInputFilterSaveValidDir()
 {
     $preferences = array('saveRawData' => '1', 'saveDir' => vfsStream::newDirectory('test', 0777)->at(vfsStream::setup('root'))->url(), 'saveFormat' => 'XML', 'saveOverwrite' => '0');
     $this->_form->setValidationGroup('Preferences');
     $this->_form->setData(array('Preferences' => $preferences));
     $this->assertTrue($this->_form->isValid());
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:7,代码来源:RawDataTest.php

示例8: testDirectoryReadOnly

 public function testDirectoryReadOnly()
 {
     $url = vfsStream::newDirectory('test', 00)->at($this->_root)->url();
     $validator = new DirectoryWritable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(array(DirectoryWritable::WRITABLE => "Verzeichnis '{$url}' ist nicht schreibbar"), $validator->getMessages());
 }
开发者ID:patrickpreuss,项目名称:Braintacle,代码行数:7,代码来源:DirectoryWritableTest.php

示例9: testDirectoryNonReadable

 public function testDirectoryNonReadable()
 {
     $url = vfsStream::newDirectory('test', 00)->at($this->_root)->url();
     $validator = new FileReadable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(FileReadable::FILE, key($validator->getMessages()));
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:7,代码来源:FileReadableTest.php

示例10: testDecodeInventoryActionInputNotFile

 public function testDecodeInventoryActionInputNotFile()
 {
     $inputFile = vfsStream::newDirectory('test')->at(vfsStream::setup('root'))->url();
     $this->dispatch($inputFile);
     $this->assertEquals(10, $this->getResponseStatusCode());
     $this->assertConsoleOutputContains("Input file does not exist or is not readable.\n");
 }
开发者ID:hschletz,项目名称:braintacle,代码行数:7,代码来源:ControllerTest.php

示例11: profileClosure

 /**
  * Profile the code contained inside the closure, returning
  * an array of XHProf profiling information. Optionally
  * filtered by a set of regular expressions which the called
  * function/class must match for the result to be returned.
  *
  * Special note: the $flags default value is hardcoded to
  * avoid errors when xhprof is not loaded - instead, this
  * causes a graceful "test skipped".
  *
  * @param \Closure $closure A standard Closure that will execute exactly the code that will be profiled, nothing more.
  * @param array $methodMatchExpressions An array of PERL regular expressions to filter which methods' results are returned.
  * @param integer $flags Standard XHPROF flags for what gets profiled. Default excludes built-in functions and CPU/memory.
  * @param array $options Optional further options (second argument for xhprof_enable).
  * @return array
  */
 protected function profileClosure(\Closure $closure, array $methodMatchExpressions = array(), $flags = 1, $options = array())
 {
     if (!$this->isProfilingExtensionLoaded()) {
         $this->markTestSkipped('XHProf is not installed; test must be skipped');
     }
     $folder = vfsStream::newDirectory('profiles');
     $backup = ini_set('xhprof.output_dir', vfsStream::url('profiles'));
     xhprof_enable($flags, $options);
     $closure();
     $profile = xhprof_disable();
     ini_set('xhprof.output_dir', $backup);
     if (!empty($methodMatchExpressions)) {
         foreach ($profile as $methodIdentifier => $_) {
             $keep = FALSE;
             foreach ($methodMatchExpressions as $expression) {
                 if (preg_match($expression, $methodIdentifier)) {
                     $keep = TRUE;
                 }
             }
             if (!$keep) {
                 unset($profile[$methodIdentifier]);
             }
         }
     }
     return $profile;
 }
开发者ID:namelesscoder,项目名称:phpunit-xhprof,代码行数:42,代码来源:ProfilingTrait.php

示例12: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = new NlReader();
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('tmp');
     vfsStreamWrapper::setRoot($root);
     $this->file = vfsStream::newFile('items.csv', 0764)->withContent("73-ou-XW46\nApple\n1\na")->at($root);
 }
开发者ID:aonamrata,项目名称:FileParser,代码行数:12,代码来源:NlReaderTest.php

示例13: setUp

 public function setUp()
 {
     $this->root = VFS::setup('root');
     VFS::newDirectory('storage', 0777)->at($this->root);
     VFS::newDirectory('private', 0400)->at($this->root);
     $this->fileSystem = new LocalFileSystem();
     $this->rootObject = Mockery::mock('FileSystem\\Root')->shouldIgnoreMissing();
 }
开发者ID:lionar,项目名称:file-system,代码行数:8,代码来源:LocalFileSystemTest.php

示例14: _before

 protected function _before()
 {
     $wp = vfsStream::newDirectory('wp');
     $wpLoadFile = vfsStream::newFile('wp-load.php');
     $wpLoadFile->setContent('foo');
     $wp->addChild($wpLoadFile);
     $this->wpLoadPath = $wp->url() . '/wp-load.php';
     $this->system = $this->prophesize(System::class);
 }
开发者ID:lucatume,项目名称:wp-browser-commons,代码行数:9,代码来源:BootstrapperTest.php

示例15: setFileSystem

 protected function setFileSystem()
 {
     vfsStreamWrapper::register();
     $root = vfsStream::newDirectory('build');
     vfsStreamWrapper::setRoot($root);
     $packagesBuilder = new PackagesBuilder(new NullOutput(), vfsStream::url('build'), array('repositories' => array(array('type' => 'composer', 'url' => 'http://localhost:54715')), 'require' => array('vendor/name' => '*')), false);
     $packagesBuilder->dump(array($this->package));
     return $root;
 }
开发者ID:zyfran,项目名称:satis,代码行数:9,代码来源:PackageSelectionLoadTest.php


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