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