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


PHP vfsStream::setup方法代码示例

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


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

示例1: setUp

 /**
  * set up test environment
  */
 public function setUp()
 {
     vfsStream::setup()->lastModified(50)->lastAccessed(50)->lastAttributeModified(50);
     $this->fooUrl = vfsStream::url('root/foo.txt');
     $this->barUrl = vfsStream::url('root/bar');
     $this->bazUrl = vfsStream::url('root/bar/baz.txt');
 }
开发者ID:sunkangtaichi,项目名称:PHPAPPLISTION_START,代码行数:10,代码来源:vfsStreamWrapperFileTimesTestCase.php

示例2: setUp

 function setUp()
 {
     parent::setUp();
     $this->mock_cmd_runner = $this->getMock('TryLib_CommandRunner');
     $this->jenkins_runner = new TestRunner(self::JENKINS_URL, self::JENKINS_CLI, self::JENKINS_JOB, $this->mock_cmd_runner);
     vfsStream::setup('testDir');
 }
开发者ID:seanly,项目名称:TryLib,代码行数:7,代码来源:JenkinsRunnerTest.php

示例3: testGenerateXml

 /**
  * @large
  */
 public function testGenerateXml()
 {
     $syntaxFile = $this->fixtureDir . DIRECTORY_SEPARATOR . "test_grammar.ebnf";
     \vfsStream::setup("testdir");
     $this->assertEquals(Command::EBNF_OK, Command::main(array("s" => $syntaxFile, "o" => \vfsStream::url("testdir/out.xml"), "f" => "xml")));
     $this->assertEquals(file_get_contents($this->fixtureDir . DIRECTORY_SEPARATOR . "test_grammar.xml"), file_get_contents(\vfsStream::url("testdir/out.xml")));
 }
开发者ID:bgarrels,项目名称:ebnf,代码行数:10,代码来源:CommandTest.php

示例4: setUpVfsStream

 protected function setUpVfsStream()
 {
     if (!class_exists('vfsStream')) {
         $this->markTestSkipped('File backend tests are not available with this phpunit version.');
     }
     \vfsStream::setup('LogRoot');
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:7,代码来源:FileTest.php

示例5: setUp

 /**
  * set up test environment
  */
 public function setUp()
 {
     vfsStream::setup('root');
     $this->rootDir = vfsStream::url('root');
     $this->lostAndFound = $this->rootDir . '/lost+found/';
     mkdir($this->lostAndFound);
 }
开发者ID:mikey179,项目名称:vfsstream,代码行数:10,代码来源:FilenameTestCase.php

示例6: setUp

 /**
  * set up test environment
  */
 public function setUp()
 {
     $this->backupIncludePath = get_include_path();
     vfsStream::setup();
     mkdir('vfs://root/a/path', 0777, true);
     set_include_path('vfs://root/a' . PATH_SEPARATOR . $this->backupIncludePath);
 }
开发者ID:sunkangtaichi,项目名称:PHPAPPLISTION_START,代码行数:10,代码来源:vfsStreamResolveIncludePathTestCase.php

示例7: testWriteRecord

 /**
  * @dataProvider writeRecordProvider
  * @param unknown_type $record
  * @param unknown_type $expected
  * @param unknown_type $escape
  */
 public function testWriteRecord($record, $expected, $escape, $lr)
 {
     $dir = vfsStream::setup('base');
     $sut = new Dfp_Datafeed_File_Writer_Format_Csv_File();
     $passed = $passed2 = false;
     try {
         $sut->writeRecord(array('test', 'testing', '2.35', '"test"'));
     } catch (Dfp_Datafeed_File_Writer_Exception $e) {
         if ($e->getMessage() == 'The file is not open') {
             $passed = True;
         }
     }
     $sut->open(vfsStream::url('base/test.csv'));
     try {
         $sut->writeRecord(array('test', 'testing', '2.35', '"test"'));
     } catch (Dfp_Datafeed_File_Writer_Exception $e) {
         if ($e->getMessage() == 'The dialect is invalid') {
             $passed2 = True;
         }
     }
     $mockDialect = $this->getMock('Dfp_Datafeed_File_Format_Csv_Dialect_Interface');
     $mockDialect->expects($this->any())->method('getQuote')->will($this->returnValue('"'));
     $mockDialect->expects($this->any())->method('getDelimiter')->will($this->returnValue(','));
     $mockDialect->expects($this->any())->method('getEscape')->will($this->returnValue($escape));
     $mockDialect->expects($this->any())->method('getLineReturn')->will($this->returnValue($lr));
     $sut->setDialect($mockDialect);
     $sut->writeRecord($record);
     $this->assertEquals($expected, file_get_contents(vfsStream::url('base/test.csv')));
     //echo "\n\n";var_dump(getcwd());
 }
开发者ID:henryhayes,项目名称:dfp,代码行数:36,代码来源:FileTest.php

示例8: testGetTranslations_shouldReturnEmptyArray

 public function testGetTranslations_shouldReturnEmptyArray()
 {
     $root = vfsStream::setup('root');
     $root->addChild(new vfsStreamFile('language.php'));
     $obj = new Language_File(vfsStream::url('root/language.php'));
     $this->assertEquals(array(), $obj->getTranslations());
 }
开发者ID:railfuture,项目名称:tiki-website,代码行数:7,代码来源:ParseFileTest.php

示例9: setUp

 public function setUp()
 {
     $this->mountDir = uniqid('mount-');
     $this->basedir = uniqid('base-');
     \vfsStream::setup($this->basedir);
     // Add an entry for the mount directory to the VFS contents
     $this->vfsContents = array($this->mountDir => array());
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:8,代码来源:BaseTestCase.php

示例10: canNotRemoveWritableFileFromNonWritableDirectory

 /**
  * @test
  * @group  issue_51
  */
 public function canNotRemoveWritableFileFromNonWritableDirectory()
 {
     $structure = array('test_directory' => array('test.file' => ''));
     $root = vfsStream::setup('root', null, $structure);
     $root->getChild('test_directory')->chmod(0444);
     $root->getChild('test_directory')->getChild('test.file')->chmod(0777);
     $this->assertFalse(@unlink(vfsStream::url('root/test_directory/test.file')));
 }
开发者ID:1000k,项目名称:whattoplaynext,代码行数:12,代码来源:UnlinkTestCase.php

示例11: setUp

 protected function setUp()
 {
     // setup a mock filesystem
     $lang = vfsStream::setup('lang');
     $this->langFile = new vfsStreamFile('language.php');
     $lang->addChild($this->langFile);
     $this->filePath = vfsStream::url('lang/language.php');
     $this->obj = new Language_WriteFile_Factory();
 }
开发者ID:hurcane,项目名称:tiki-azure,代码行数:9,代码来源:FactoryTest.php

示例12: vfsStreamCanHandleUrlEncodedPath

 /**
  * @test
  */
 public function vfsStreamCanHandleUrlEncodedPath()
 {
     $content = '<xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
                                 <xs:complexType name="myType"></xs:complexType>
                             </xs:schema>';
     $structure = array('foo bar' => array('schema.xsd' => $content));
     vfsStream::setup('root', null, $structure);
     $this->assertEquals($content, file_get_contents(vfsStream::url('root/foo bar/schema.xsd')));
 }
开发者ID:kdambekalns,项目名称:vfsStream,代码行数:12,代码来源:Issue104TestCase.php

示例13: unlinkNonExistingFileTriggersError

 /**
  * @test
  * @since  1.4.0
  * @group  issue_68
  */
 public function unlinkNonExistingFileTriggersError()
 {
     vfsStream::setup();
     try {
         $this->assertFalse(unlink('vfs://root/foo.txt'));
     } catch (\PHPUnit_Framework_Error $fe) {
         $this->assertEquals('unlink(vfs://root/foo.txt): No such file or directory', $fe->getMessage());
     }
 }
开发者ID:kdambekalns,项目名称:vfsStream,代码行数:14,代码来源:UnlinkTestCase.php

示例14: __construct

 /**
  * Registers vfsStream
  *
  * @param PHPUnit_Framework_TestCase $testCase
  *
  * @return vfsStreamHelper_Wrapper
  */
 public function __construct(PHPUnit_Framework_TestCase $testCase, $mountPoint = 'root')
 {
     @(include_once 'vfsStream/vfsStream.php');
     if (!class_exists('vfsStreamWrapper')) {
         $testCase->markTestSkipped('vfsStream is not available - skipping');
     } else {
         vfsStream::setup($mountPoint);
     }
 }
开发者ID:proofek,项目名称:vfsStreamHelper,代码行数:16,代码来源:Wrapper.php

示例15: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     vfsStream::setup('exampleDir');
     $file = vfsStream::newFile('test1.php');
     vfsStreamWrapper::getRoot()->addChild($file);
     $file->setContent('__' . '("test1"); __' . '(\'test2\')');
     $this->Translation_File_Source = new Translation_File_Source(vfsStream::url('exampleDir/test1.php'));
 }
开发者ID:spalax,项目名称:zf2-translation-scanner,代码行数:12,代码来源:SourceTest.php


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