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


PHP vfsStream::inspect方法代码示例

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


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

示例1: testConstruct

 public function testConstruct()
 {
     $this->assertFileExists($this->configDir->url() . DIRECTORY_SEPARATOR . 'test');
     unset($configHandler);
     new ConfigFileHandler('test-process', $this->configDirPath);
     $this->assertEquals(['root' => ['test' => []]], vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
开发者ID:HEXA-UA,项目名称:supervisor-manager,代码行数:7,代码来源:ConfigFileHandlerTest.php

示例2: testPageEdit

 /**
  * @dataProvider pagesProvider
  */
 public function testPageEdit($values, $events, $logs, $expectedPage)
 {
     $pages = array("new-page-1" => array("admin.json" => '{"name":"new-page-1","currentName":"new-page-1","template":"home","isHome":false}', "page.json" => '{"name":"new-page-1","currentName":"new-page-1","template":"home","isHome":false}', "en_GB" => array("admin.json" => '{"permalink":"en-gb-new-page-1","title":"new-page-1-title","description":"new-page-1-description","keywords":"new-page-1-keywords","sitemap_frequency":"monthly","sitemap_priority":"0.5"}')));
     $this->init($pages);
     $this->initDispatcherAndLogger($events, $logs);
     $this->pageManger->contributor('admin')->edit($values);
     $structure = vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
     $this->assertEquals($expectedPage, $structure["localhost"]["pages"]["pages"]);
 }
开发者ID:redkite-labs,项目名称:redkitecms-framework,代码行数:12,代码来源:PageCollectionManagerTest.php

示例3: write

 /**
  * @test
  */
 public function write()
 {
     $messages = 'Messages will be here';
     $printer = $this->createPrinter($this->validRoot->url());
     $printer->write($messages);
     $expectedStructure = vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
     // Assert that string was written
     $this->assertEquals(['root' => ['test.json' => $messages]], $expectedStructure);
 }
开发者ID:vanare,项目名称:behat-cucumber-json-formatter,代码行数:12,代码来源:FileOutputPrinterTest.php

示例4: testBuildSiteHandlingTheme

 public function testBuildSiteHandlingTheme()
 {
     $folders = array('RedKiteCMS' => array('app' => array('cache' => array(), 'config' => array(), 'data' => array('redkitecms.com' => array('config' => array(), 'pages' => array('pages' => array()), 'roles' => array(), 'slots' => array(), 'users' => array())), 'logs' => array(), 'plugins' => array('RedKiteCms' => array('Block' => array(), 'Theme' => array())), 'RedKiteCms.php' => 'class RedKiteCms extends RedKiteCmsBase{}'), 'src' => array(), 'web' => array()));
     vfsStream::setup('www', null, $folders);
     $siteBuilder = new SiteBuilder(vfsStream::url('www/RedKiteCMS'), 'redkitecms.com');
     $siteBuilder->theme("FooTheme")->handleTheme(true)->build();
     $structure = vfsStream::inspect(new \org\bovigo\vfs\visitor\vfsStreamStructureVisitor())->getStructure();
     $siteStructure = array("redkitecms.com" => array("config" => array(), "pages" => array("pages" => array()), "roles" => array("roles.json" => '["ROLE_ADMIN"]'), "slots" => array(), "users" => array("users.json" => '{"admin":{"roles":["ROLE_ADMIN"],"password":"RVxE\\/NkQGEhSimsAzsmSIwDv1p+lhP5SDT6Gfnh8QS32yk7W6A+pW5GXUBxJ3ud9La5khARoH2uQ5VRYkPG\\/Fw==","salt":"q4mfgrnsn2occ4kw4k008cskkwkg800"}}'), "RedKiteCms.php" => 'class RedKiteCms extends RedKiteCmsBase{}', "site.json" => '{"theme":"FooTheme","homepage":"homepage","locale_default":"en_GB","homepage_permalink":"en-gb-homepage","languages":["en_GB"],"handled_theme":"FooTheme"}', "incomplete.json" => null));
     $this->assertEquals($siteStructure, $structure["www"]["RedKiteCMS"]["app"]["data"]);
 }
开发者ID:redkite-labs,项目名称:redkitecms-framework,代码行数:10,代码来源:SiteBuilderTest.php

示例5: windowsPathsCanBeProcessed

 /**
  * @test
  */
 public function windowsPathsCanBeProcessed()
 {
     $cRoot = 'C:\\Windows\\Root\\Path\\';
     $root = vfsStream::setup('root');
     FileStreamWrapper::init($cRoot);
     FileStreamWrapper::registerOverlayPath('fileadmin', 'vfs://root/fileadmin');
     touch($cRoot . 'fileadmin\\someFile.txt');
     $expectedFileStructure = array('root' => array('fileadmin' => array('someFile.txt' => NULL)));
     $this->assertEquals($expectedFileStructure, vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
     FileStreamWrapper::destroy();
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:14,代码来源:FileStreamWrapperTest.php

示例6: testBootEnvironment

 /**
  * @covers ::bootEnvironment
  */
 public function testBootEnvironment() {
   $this->assertRegExp('/^simpletest\d{6}$/', $this->databasePrefix);
   $this->assertStringStartsWith('vfs://root/sites/simpletest/', $this->siteDirectory);
   $this->assertEquals(array(
     'root' => array(
       'sites' => array(
         'simpletest' => array(
           substr($this->databasePrefix, 10) => array(
             'files' => array(
               'config' => array(
                 'staging' => array(),
               ),
             ),
           ),
         ),
       ),
     ),
   ), vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
开发者ID:komejo,项目名称:article-test,代码行数:22,代码来源:KernelTestBaseTest.php

示例7: testBackupRestore

 /**
  * @covers exportToFile
  * @covers importFromFile
  */
 public function testBackupRestore()
 {
     $file = $this->source->exportToFile();
     // Move the file to the tmp directory so we can use command line untar.
     $tarball = tempnam('/tmp', 'bamtest');
     copy($file->realpath(), $tarball);
     // Untar the file and see if all of the files are there.
     $this->_compareTarballToFilelist($this->file_list['files'], $tarball);
     // Restore to another directory.
     $source = new FileDirectorySource(new Config(['directory' => 'vfs://root/restore/']));
     $source->setArchiveWriter(new \BackupMigrate\Core\Service\TarArchiveWriter());
     $source->setArchiveReader(new \BackupMigrate\Core\Service\TarArchiveReader());
     $source->setTempFileManager($this->manager);
     $source->importFromFile($file);
     $result = vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
     $this->assertEquals($this->file_list['files'], $result['root']['restore']);
     // Clean up
     unlink($tarball);
 }
开发者ID:Wylbur,项目名称:gj,代码行数:23,代码来源:FileDirectorySourceTest.php

示例8: vfsDump

 /**
  * Dumps the current state of the virtual filesystem to STDOUT.
  */
 protected function vfsDump()
 {
     vfsStream::inspect(new vfsStreamPrintVisitor());
 }
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:7,代码来源:KernelTestBase.php

示例9: getStructure

 public function getStructure()
 {
     return vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
 }
开发者ID:giftnuss,项目名称:PieCrust,代码行数:4,代码来源:MockFileSystem.php

示例10: dumpFilesystemStructure

 public function dumpFilesystemStructure()
 {
     vfsStream::inspect(new vfsStreamPrintVisitor());
 }
开发者ID:wackamole0,项目名称:rainmaker-tool,代码行数:4,代码来源:FilesystemMock.php

示例11: testCmsHasBeenBootstrapped

 public function testCmsHasBeenBootstrapped()
 {
     $this->initContainer();
     $themeSlots = $this->getMock('\\RedKiteLabs\\ThemeEngineBundle\\Core\\ThemeSlots\\ThemeSlotsInterface');
     $themeSlots->expects($this->once())->method('getSlots')->will($this->returnValue(array()));
     $activeTheme = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\ActiveTheme\\ActiveThemeInterface');
     $activeTheme->expects($this->once())->method('getThemeBootstrapVersion')->will($this->returnValue('2.x'));
     $theme = $this->getMockBuilder('RedKiteLabs\\ThemeEngineBundle\\Core\\Theme\\Theme')->disableOriginalConstructor()->getMock();
     $theme->expects($this->once())->method('getThemeSlots')->will($this->returnValue($themeSlots));
     $activeTheme->expects($this->once())->method('getActiveThemeBackend')->will($this->returnValue($theme));
     $this->container->expects($this->at(2))->method('get')->with('red_kite_cms.active_theme')->will($this->returnValue($activeTheme));
     $this->container->expects($this->at(3))->method('getParameter')->with('red_kite_labs_theme_engine.deploy_bundle')->will($this->returnValue('@AcmeWebSiteBundle'));
     $this->container->expects($this->at(4))->method('getParameter')->with('red_kite_cms.deploy_bundle.assets_base_dir')->will($this->returnValue('asset-base-dir'));
     $this->container->expects($this->at(5))->method('getParameter')->with('red_kite_cms.deploy_bundle.media_dir')->will($this->returnValue('media'));
     $this->container->expects($this->at(6))->method('getParameter')->with('red_kite_cms.deploy_bundle.js_dir')->will($this->returnValue('js'));
     $this->container->expects($this->at(7))->method('getParameter')->with('red_kite_cms.deploy_bundle.css_dir')->will($this->returnValue('css'));
     $this->container->expects($this->at(8))->method('getParameter')->with('red_kite_cms.upload_assets_full_path')->will($this->returnValue(vfsStream::url('root/cms-assets/uploades-base-dir')));
     $this->container->expects($this->at(9))->method('getParameter')->with('red_kite_cms.deploy_bundle.media_dir')->will($this->returnValue('media'));
     $this->container->expects($this->at(10))->method('getParameter')->with('red_kite_cms.deploy_bundle.js_dir')->will($this->returnValue('js'));
     $this->container->expects($this->at(11))->method('getParameter')->with('red_kite_cms.deploy_bundle.css_dir')->will($this->returnValue('css'));
     $request = $this->getMock('Symfony\\Component\\HttpFoundation\\Request');
     $this->container->expects($this->at(12))->method('get')->with('request')->will($this->returnValue($request));
     $this->container->expects($this->at(13))->method('get')->with('red_kite_cms.data_manager')->will($this->returnValue($this->dataManager));
     $templateManager = $this->getMockBuilder('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\Template\\TemplateManager')->disableOriginalConstructor()->getMock();
     $this->container->expects($this->at(14))->method('get')->with('red_kite_cms.template_manager')->will($this->returnValue($templateManager));
     $pageBlocks = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Content\\PageBlocks\\PageBlocksInterface');
     $this->container->expects($this->at(15))->method('get')->with('red_kite_cms.page_blocks')->will($this->returnValue($pageBlocks));
     $this->container->expects($this->at(16))->method('get')->with('red_kite_cms.repeated_slots_aligner')->will($this->returnValue($this->aligner));
     $twig = $this->getMock('\\Twig_Environment');
     $twig->expects($this->at(0))->method('addGlobal')->with('bootstrap_version', '2.x');
     $twig->expects($this->at(1))->method('addGlobal')->with('cms_language');
     $this->container->expects($this->at(17))->method('get')->with('twig')->will($this->returnValue($twig));
     $configuration = $this->getMock('RedKiteLabs\\RedKiteCms\\RedKiteCmsBundle\\Core\\Configuration\\ConfigurationInterface');
     $configuration->expects($this->once())->method('read')->with('language');
     $this->container->expects($this->at(18))->method('get')->with('red_kite_cms.configuration')->will($this->returnValue($configuration));
     $this->container->expects($this->at(19))->method('get')->with('twig')->will($this->returnValue($twig));
     $this->setupFolders();
     $this->kernel->expects($this->once())->method('locateResource')->will($this->returnValue(vfsStream::url('root/frontend-assets')));
     $this->pageTree->expects($this->once())->method('setDataManager')->will($this->returnSelf());
     $this->pageTree->expects($this->once())->method('setup')->with($theme, $templateManager, $pageBlocks);
     $template = $this->getMockBuilder('RedKiteLabs\\ThemeEngineBundle\\Core\\Template\\Template')->disableOriginalConstructor()->getMock();
     $this->pageTree->expects($this->once())->method('getTemplate')->will($this->returnValue($template));
     $this->aligner->expects($this->once())->method('setLanguageId')->will($this->returnSelf());
     $this->aligner->expects($this->once())->method('setPageId')->will($this->returnSelf());
     $this->aligner->expects($this->once())->method('align');
     $expectedResult = array('root' => array('frontend-assets' => array('asset-base-dir' => array('media' => array(), 'js' => array(), 'css' => array())), 'cms-assets' => array('uploades-base-dir' => array('media' => array(), 'js' => array(), 'css' => array()))));
     $testListener = new CmsBootstrapListener($this->container);
     $testListener->onKernelRequest($this->event);
     $this->assertEquals($expectedResult, vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
开发者ID:iicc,项目名称:RedKiteCmsBundle,代码行数:50,代码来源:CmsBootstrapListenerTest.php

示例12: testDoNotReplaceFiles

 public function testDoNotReplaceFiles()
 {
     $root = vfsStream::setup('project', null, array('vendor' => array('dimug' => array('locales' => array('de.yml' => 'Hallo Welt!', 'en.yml' => 'Hello world!'))), 'locales' => array('de.yml' => 'Hallo Welt!')));
     $this->assertTrue($root->hasChild('locales'));
     $this->setUp(array(array('target' => vfsStream::url('project/locales'), 'source' => vfsStream::url('project/vendor/dimug/locales'), 'files' => array('de.yml', 'en.yml'))));
     $this->assertRegExp('/The target file "vfs:\\/\\/project\\/locales\\/de.yml" already exists! File skipped!/', $this->command->getDisplay());
     $this->assertRegExp('/All files have been copied!/', $this->command->getDisplay());
     $this->assertEquals(array('project' => array('vendor' => array('dimug' => array('locales' => array('de.yml' => 'Hallo Welt!', 'en.yml' => 'Hello world!'))), 'locales' => array('de.yml' => 'Hallo Welt!', 'en.yml' => 'Hello world!'))), vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure());
 }
开发者ID:dimug,项目名称:api,代码行数:9,代码来源:InstallCommandTest.php

示例13: inspectVfs

 /**
  * Retrieves the virtual file system structure
  *
  * @return array
  */
 protected function inspectVfs()
 {
     return vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
 }
开发者ID:novuso,项目名称:system,代码行数:9,代码来源:VirtualFileSystem.php


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