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


PHP vfsStreamDirectory::hasChild方法代码示例

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


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

示例1: testWriteIsWritingYamlIntoFile

 /**
  * @depends testInstanceOf
  */
 public function testWriteIsWritingYamlIntoFile()
 {
     $yamlWriterProvider = new YamlWriterProvider($this->mockWriter);
     $this->mockWriter->expects($this->once())->method('dump')->with(array('result' => false))->willReturn('result: false');
     $yamlWriterProvider->write(vfsStream::url('settings/config.yml'), array('result' => false));
     $this->assertTrue($this->root->hasChild('settings/config.yml'));
 }
开发者ID:destebang,项目名称:taskreporter-1,代码行数:10,代码来源:YamlWriterProviderTest.php

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

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

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

示例5: testCanCreateInstanceWithLogDirCreation

 /**
  * @covers \EscoMail\Service\MailLogger::__construct
  * @covers \EscoMail\Service\MailLogger::getLogDirPath
  */
 public function testCanCreateInstanceWithLogDirCreation()
 {
     $configArray = array('log_dir' => vfsStream::url('exampleDir') . '/tmp');
     $serviceManager = new ServiceManager();
     $options = new ModuleOptions($configArray);
     $mailLogger = new MailLogger($options, $serviceManager);
     $this->assertInstanceOf('EscoMail\\Service\\MailLogger', $mailLogger);
     $this->assertTrue($this->root->hasChild('tmp/mail.log'));
 }
开发者ID:guliano,项目名称:esco-mail,代码行数:13,代码来源:MailLoggerTest.php

示例6: testUpdateAddressFormatsRemovesLegacyFiles

 /**
  * @covers ::updateAddressFormats
  */
 public function testUpdateAddressFormatsRemovesLegacyFiles()
 {
     $this->root->addChild(new vfsStreamFile('legacy.json'));
     $httpClient = new HttpClient();
     $httpClient->setAdapter(new HttpTestAdapter());
     $maintenanceService = new MaintenanceService($this->options, $httpClient);
     $maintenanceService->updateAddressFormats();
     $this->assertFalse($this->root->hasChild('legacy.json'));
 }
开发者ID:DavidHavl,项目名称:Ajasta,代码行数:12,代码来源:MaintenanceServiceTest.php

示例7: testProcessCreatesDirectories

 /**
  * @covers \Heystack\Core\DataObjectGenerate\DataObjectGenerator::process
  */
 public function testProcessCreatesDirectories()
 {
     $this->schemaService->expects($this->once())->method('getSchemas')->will($this->returnValue([]));
     ob_start();
     $this->generator->process();
     ob_end_clean();
     $this->assertTrue(file_exists(vfsStream::url('root')));
     $this->assertTrue($this->root->hasChild('cache'));
 }
开发者ID:helpfulrobot,项目名称:heystack-heystack,代码行数:12,代码来源:DataObjectGeneratorTest.php

示例8: testCreateServiceWithDirectoryCreation

 public function testCreateServiceWithDirectoryCreation()
 {
     $configArray = array('transport_class' => 'Zend\\Mail\\Transport\\File', 'transport_options' => array('path' => vfsStream::url('exampleDir') . '/tmp'));
     $config = new ModuleOptions($configArray);
     $this->serviceManager->setService('EscoMail\\Options', $config);
     $factory = new TransportFactory();
     $transport = $factory->createService($this->serviceManager);
     $this->assertInstanceOf('Zend\\Mail\\Transport\\File', $transport);
     $this->assertTrue($this->root->hasChild('tmp'));
 }
开发者ID:guliano,项目名称:esco-mail,代码行数:10,代码来源:TransportFactoryTest.php

示例9: 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'));
     $this->adapter->upload('bar/foo.txt', $input);
     $this->assertFalse($this->vfs->hasChild('foo.txt'));
     $this->assertTrue($this->vfs->getChild('uploads')->hasChild('bar'));
     $this->assertTrue($this->vfs->getChild('uploads')->getChild('bar')->hasChild('foo.txt'));
 }
开发者ID:radnan,项目名称:rdn-upload,代码行数:10,代码来源:LocalTest.php

示例10: testContainerCreated

 /**
  * @covers \Heystack\Core\Console\Command\GenerateContainer::__construct
  * @covers \Heystack\Core\Console\Command\GenerateContainer::execute
  * @covers \Heystack\Core\Console\Command\GenerateContainer::configure
  * @covers \Heystack\Core\Console\Command\GenerateContainer::createContainer
  * @covers \Heystack\Core\Console\Command\GenerateContainer::loadConfig
  * @covers \Heystack\Core\Console\Command\GenerateContainer::dumpContainer
  */
 public function testContainerCreated()
 {
     $command = $this->getMock(__NAMESPACE__ . '\\GenerateContainer', ['getRealPath'], [vfsStream::url('root'), vfsStream::url('root/heystack')]);
     $command->expects($this->once())->method('getRealPath')->will($this->returnArgument(0));
     $application = new Application();
     $application->add($command);
     $application->find('generate-container');
     $commandTester = new CommandTester($command);
     $commandTester->execute(['command' => $command->getName()]);
     $this->assertTrue($this->rootFileSystem->hasChild('heystack/cache/HeystackServiceContainerlive.php'));
     $this->assertContains('class HeystackServiceContainerlive extends Heystack\\Core\\DependencyInjection\\SilverStripe\\HeystackSilverStripeContainer', file_get_contents(vfsStream::url('root/heystack/cache/HeystackServiceContainerlive.php')));
 }
开发者ID:helpfulrobot,项目名称:heystack-heystack,代码行数:20,代码来源:GenerateContainerTest.php

示例11: testExecute

 public function testExecute()
 {
     $application = new Application();
     $application->add(new Init(null, vfsStream::url('root')));
     $command = $application->find('init');
     $commandTester = new CommandTester($command);
     $commandTester->execute(['command' => $command->getName()]);
     $this->assertTrue($this->fs->hasChild('views'));
     $this->assertTrue($this->fs->hasChild('cache'));
     $this->assertTrue($this->fs->hasChild('compiled'));
     $this->assertTrue($this->fs->hasChild('public'));
     $this->assertFileExists(vfsStream::url('root/public/index.php'));
     $this->assertRegExp('/Initialization complete!/', $commandTester->getDisplay());
 }
开发者ID:wilgucki,项目名称:blade-builder,代码行数:14,代码来源:InitTest.php

示例12: testModuleInit

 public function testModuleInit()
 {
     $this->vfsRoot->addChild($this->createFile('file1'));
     $this->vfsRoot->addChild($this->createFile('file1'));
     $this->vfsRoot->addChild(vfsStream::newDirectory('dir1'));
     AspectMock::double(\Codeception\Configuration::class, ['outputDir' => vfsStream::url('outputDir')]);
     // Cleansman needs no configuration atm
     $event = m::mock(\Codeception\Event\SuiteEvent::class);
     $sut = new \Codeception\Extension\Cleansman([], ['silent' => false]);
     // Actual cleanup happens here
     $sut->moduleInit($event);
     $this->assertFalse($this->vfsRoot->hasChild('file1'));
     $this->assertFalse($this->vfsRoot->hasChild('file2'));
     $this->assertFalse($this->vfsRoot->hasChild('dir1'));
 }
开发者ID:carstenwindler,项目名称:cleansman,代码行数:15,代码来源:ModuleInitTest.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: testProcess

 public function testProcess()
 {
     $file = new \SplFileInfo(vfsStream::url('root/sample.jpg'));
     $resultFile = $this->provider->process($this->media, $this->variant, $file);
     $filename = $resultFile->getBasename();
     $this->assertStringEndsWith('-temp-sample.jpg', $filename);
     $this->assertTrue($this->dir->hasChild($filename));
 }
开发者ID:jmcclell,项目名称:OryzoneMediaStorage,代码行数:8,代码来源:ImageProviderTest.php

示例15: testConstruct

    /**
     * @covers Intacct\Functions\Company\AttachmentFile::writeXml
     */
    public function testConstruct()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<attachment>
    <attachmentname>input</attachmentname>
    <attachmenttype>csv</attachmenttype>
    <attachmentdata>aGVsbG8sd29ybGQKdW5pdCx0ZXN0</attachmentdata>
</attachment>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $record = new AttachmentFile();
        $this->assertTrue($this->root->hasChild('csv/input.csv'));
        $record->setFilePath($this->root->url() . '/csv/input.csv');
        $record->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:24,代码来源:AttachmentFileTest.php


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