本文整理汇总了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());
}
示例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"]);
}
示例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);
}
示例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"]);
}
示例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();
}
示例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());
}
示例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);
}
示例8: vfsDump
/**
* Dumps the current state of the virtual filesystem to STDOUT.
*/
protected function vfsDump()
{
vfsStream::inspect(new vfsStreamPrintVisitor());
}
示例9: getStructure
public function getStructure()
{
return vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
}
示例10: dumpFilesystemStructure
public function dumpFilesystemStructure()
{
vfsStream::inspect(new vfsStreamPrintVisitor());
}
示例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());
}
示例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());
}
示例13: inspectVfs
/**
* Retrieves the virtual file system structure
*
* @return array
*/
protected function inspectVfs()
{
return vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure();
}