當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vfsStream::umask方法代碼示例

本文整理匯總了PHP中org\bovigo\vfs\vfsStream::umask方法的典型用法代碼示例。如果您正苦於以下問題:PHP vfsStream::umask方法的具體用法?PHP vfsStream::umask怎麽用?PHP vfsStream::umask使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org\bovigo\vfs\vfsStream的用法示例。


在下文中一共展示了vfsStream::umask方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Sets up the required fixtures.
  */
 public function setUp()
 {
     $mockConfig = ['ClassContent' => [], 'Config' => ['bootstrap.yml' => file_get_contents(__DIR__ . '/Config/bootstrap.yml'), 'bundles.yml' => file_get_contents(__DIR__ . '/Config/bundles.yml'), 'config.yml' => file_get_contents(__DIR__ . '/Config/config.yml'), 'doctrine.yml' => file_get_contents(__DIR__ . '/Config/doctrine.yml'), 'logging.yml' => file_get_contents(__DIR__ . '/Config/logging.yml'), 'security.yml' => file_get_contents(__DIR__ . '/Config/security.yml'), 'services.yml' => file_get_contents(__DIR__ . '/Config/services.yml')], 'Ressources' => [], 'cache' => ['Proxies' => [], 'twig' => []]];
     vfsStream::umask(00);
     vfsStream::setup('repositorydir', 0777, $mockConfig);
     $mockApp = new MockBBApplication(null, null, false, $mockConfig, __DIR__ . '/../vendor');
     $this->bundle = $mockApp->getBundle('theme');
 }
開發者ID:backbee,項目名稱:theme-bundle,代碼行數:11,代碼來源:ThemeTestCase.php

示例2: testExecute

    /**
     * @covers ::execute
     */
    public function testExecute()
    {
        // mock the Kernel or create one depending on your needs
        $application = new Console(self::$app);
        $application->add(new AclLoadCommand());
        $command = $application->find('acl:load');
        $commandTester = new CommandTester($command);
        vfsStream::umask(00);
        $this->_mock_basedir = vfsStream::setup('test_dir', 0777, array('file.yml' => '
groups:
  super_admin:
    sites:
      resources: all
      actions: all
            '));
        $commandTester->execute(array('command' => $command->getName(), 'file' => 'vfs://test_dir/file.yml'));
        $this->assertContains('Processing file: vfs://test_dir/file.yml', $commandTester->getDisplay());
    }
開發者ID:mickaelsteinberg,項目名稱:BackBee,代碼行數:21,代碼來源:AclLoadCommandTest.php

示例3: testOnApplicationInitRaisesContainerDirectoryNotWritableException

 public function testOnApplicationInitRaisesContainerDirectoryNotWritableException()
 {
     $basic_services_yml = array('parameters' => array('bbapp.logger.class' => 'BackBee\\Logging\\Logger', 'bbapp.logger_debug.class' => 'BackBee\\Logging\\DebugStackLogger'));
     $bootstrap_yml = array('debug' => false, 'container' => array('dump_directory' => 'vfs://no_rights_base_directory/container', 'autogenerate' => true));
     $resources_directory = realpath(__DIR__ . '/../ContainerBuilderTest_Ressources/');
     $virtual_structure = array('backbee' => array('Config' => array('services' => array('services.yml' => \Symfony\Component\Yaml\Yaml::dump($basic_services_yml)))), 'repository' => array('Config' => array('bootstrap.yml' => \Symfony\Component\Yaml\Yaml::dump($bootstrap_yml))), 'container' => array());
     vfsStream::umask(0222);
     vfsStream::setup('cant_write_base_directory', 0777, $virtual_structure);
     $application = $this->generateManualBBApplication(vfsStream::url('cant_write_base_directory'));
     $application->setContainer((new ContainerBuilder($application))->getContainer());
     $container = $application->getContainer();
     $application->setDebug_Mode(false);
     $container->setParameter('container.dump_directory', $application->getBaseDir() . '/container');
     $this->assertFalse($container->isFrozen());
     $event = new Event($application);
     try {
         ContainerListener::onApplicationInit($event);
         $this->fail('Raise of ContainerDirectoryNotWritableException expected.');
     } catch (\Exception $e) {
         $this->assertInstanceOf('BackBee\\DependencyInjection\\Exception\\ContainerDirectoryNotWritableException', $e);
     }
 }
開發者ID:gobjila,項目名稱:BackBee,代碼行數:22,代碼來源:ContainerListenerTest.php

示例4: createFilesystem

 protected function createFilesystem()
 {
     vfsStream::umask(00);
     $filesystem = vfsStream::setup('tmp', null, ['upload' => ['test.txt' => 'Lorem ipsum dolor sit amet']]);
     return $filesystem;
 }
開發者ID:novuso,項目名稱:NovusoCommonBundle,代碼行數:6,代碼來源:ActionTest.php

示例5: resetStructure

 public function resetStructure()
 {
     if (null !== $this->mockedStructure) {
         vfsStream::umask(00);
         vfsStream::setup('repositorydir', 0777, $this->mockedStructure);
     }
 }
開發者ID:gobjila,項目名稱:BackBee,代碼行數:7,代碼來源:MockBBApplication.php

示例6: createVfs

 /**
  * Creates a virtual file system
  *
  * @param array  $structure A nested array keyed by folder or filename;
  *                           array values for sub-directories
  * @param string $baseDir   The name of the base directory
  * @param int    $umask     Umask setting for the virtual file system
  *
  * @return vfsStreamDirectory
  */
 protected function createVfs(array $structure, $baseDir = 'root', $umask = 022)
 {
     vfsStream::umask($umask);
     return vfsStream::setup($baseDir, null, $structure);
 }
開發者ID:novuso,項目名稱:system,代碼行數:15,代碼來源:VirtualFileSystem.php


注:本文中的org\bovigo\vfs\vfsStream::umask方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。