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


PHP vfsStreamDirectory::getChild方法代码示例

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


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

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

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

示例3:

 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

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

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

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

示例7: pathToUrl

 protected function pathToUrl($path = '')
 {
     //@todo Consider adding hasChild() test and throw exception if test fails?
     if ($this->root->hasChild(ltrim($path, '/'))) {
         return $this->root->getChild(ltrim($path, '/'))->url();
     }
     return $this->root->url() . $path;
 }
开发者ID:wackamole0,项目名称:rainmaker-tool,代码行数:8,代码来源:FilesystemMock.php

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

示例9: testItSavesTypeClassFiles

 public function testItSavesTypeClassFiles()
 {
     $this->sut->save(FooBarType::class, 'foobar_type_class_content');
     $filename = base64_encode(FooBarType::class) . '.php';
     $this->assertTrue($this->root->hasChild($filename));
     $child = $this->root->getChild($filename);
     $this->assertEquals('<?php foobar_type_class_content', file_get_contents($child->url()));
 }
开发者ID:wirus15,项目名称:enum-bundle,代码行数:8,代码来源:FileEnumTypeStorageTest.php

示例10: testEnumTypeDefinitionsFromBundles

 public function testEnumTypeDefinitionsFromBundles()
 {
     $this->container->setParameter('kernel.bundles', ['FooBundle', 'BarBundle']);
     require_once $this->root->getChild('src/FooBundle/FooBundle.php')->url();
     require_once $this->root->getChild('src/BarBundle/BarBundle.php')->url();
     $this->container->compile();
     $this->assertAddTypeCalls(['foobar' => FooBarType::class, 'onetwo' => OneTwoType::class, 'threefour' => OneTwoType::class]);
 }
开发者ID:wirus15,项目名称:enum-bundle,代码行数:8,代码来源:EnumExtensionTest.php

示例11: testFileIsOnDestinationAfterShift

 public function testFileIsOnDestinationAfterShift()
 {
     $shift = new DefaultShift($this->root->url() . '/testfile1', $this->root->url() . '/testfile1Shifted');
     $shift->execute();
     /** @var vfsStreamFile $shiftedFile */
     $shiftedFile = $this->root->getChild('testfile1Shifted');
     $this->assertNotNull($shiftedFile);
     $this->assertEquals('testfile1Shifted', $shiftedFile->getName());
     $this->assertEquals('TestContent', $shiftedFile->getContent());
 }
开发者ID:fashionforhome,项目名称:s3fileshifter,代码行数:10,代码来源:DefaultShiftTest.php

示例12: testShouldBeAbleToCopyFile

 public function testShouldBeAbleToCopyFile()
 {
     $this->root->addChild(vfsStream::newFile('testfile1copy')->setContent('TestContent'));
     $copy = new DefaultCopy($this->root->url() . '/testfile1', $this->root->url() . '/testfile1copy');
     $copy->execute();
     /** @var vfsStreamFile $copiedFile */
     $copiedFile = $this->root->getChild('testfile1copy');
     $this->assertEquals('testfile1copy', $copiedFile->getName());
     $this->assertEquals('TestContent', $copiedFile->getContent());
 }
开发者ID:fashionforhome,项目名称:s3fileshifter,代码行数:10,代码来源:DefaultCopyTest.php

示例13: testUpload

 public function testUpload()
 {
     $this->assertTrue($this->vfs->getChild('tmp')->hasChild('foo.txt'));
     $this->assertFalse($this->vfs->getChild('uploads')->hasChild('bar'));
     $input = new File('foo.txt', vfsStream::url('root/tmp/foo.txt'));
     $id = $this->uploads->upload($input);
     $this->assertFalse($this->vfs->hasChild('foo.txt'));
     $parts = explode('/', $id);
     $leaf = array_pop($parts);
     $child = $this->vfs->getChild('uploads');
     foreach ($parts as $part) {
         $this->assertTrue($child->hasChild($part));
         $child = $child->getChild($part);
     }
     $this->assertTrue($child->hasChild($leaf));
 }
开发者ID:radnan,项目名称:rdn-upload,代码行数:16,代码来源:ContainerTest.php

示例14: testNotifyBatch

 public function testNotifyBatch()
 {
     $packagesBuilder = new PackagesBuilder(new NullOutput(), vfsStream::url('build'), ['notify-batch' => 'http://localhost:54715/notify', 'repositories' => [['type' => 'composer', 'url' => 'http://localhost:54715']], 'require' => ['vendor/name' => '*']], false);
     $packagesBuilder->dump(self::createPackages(1));
     $packagesJson = JsonFile::parseJson($this->root->getChild('build/packages.json')->getContent());
     $this->assertEquals('http://localhost:54715/notify', $packagesJson['notify-batch']);
 }
开发者ID:composer,项目名称:satis,代码行数:7,代码来源:PackagesBuilderDumpTest.php

示例15: given_dump_file_appended

 protected function given_dump_file_appended($new_mail)
 {
     $dump = $this->tmp_dir->getChild(self::DUMP_FILE);
     /** @var vfsStreamFile $dump */
     $content = $dump->getContent();
     $content .= $new_mail;
     $dump->setContent($content);
 }
开发者ID:edusegzy,项目名称:mailhook,代码行数:8,代码来源:MailhookSpec.php


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