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


PHP vfsStreamDirectory::path方法代码示例

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


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

示例1: testItLoadsItemsIntoProcessor

 public function testItLoadsItemsIntoProcessor()
 {
     $index = $this->createIndex();
     $index->expects($this->once())->method('getHandleIncludes')->with('handle_one')->willReturn(array(Stream::url($this->fileSystem->path() . '/handle_one_file1.php'), Stream::url($this->fileSystem->path() . '/handle_one_file2.php')));
     $processor = $this->createProcessor();
     $processor->expects($this->exactly(3))->method('addItem')->id('addItem')->withConsecutive(array($this->equalTo(new RemoveItem('handle_one_block_one'))), array($this->equalTo(new RemoveItem('handle_one_block_two'))), array($this->equalTo(new RemoveItem('handle_one_block_three'))))->willReturnSelf();
     $processor->expects($this->once())->method('addItemRelation')->after('addItem')->with($this->equalTo(new RemoveItem('handle_one_block_three')), 'handle_one_block_three')->willReturnSelf();
     $this->assertSame($this->loader, $this->loader->loadIntoProcessor('handle_one', $processor, $index));
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:9,代码来源:LoaderTest.php

示例2: setUp

 protected function setUp()
 {
     $this->fileSystem = Stream::setup();
     $annotations = $this->getAnnotations()['method'];
     if (isset($annotations['sourceFile'])) {
         $fileName = current($annotations['sourceFile']);
         $this->source = new SourceFile(Stream::url($this->fileSystem->path() . '/' . $fileName));
     }
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:9,代码来源:FileTest.php

示例3: testItSaveMetaDataObjectsToFile

 /**
  * @param EcomDev_LayoutCompiler_Compiler_Metadata[] $metadataObjects
  * @param string $expectedFileContent
  *
  * @dataProvider dataProviderMetadataObjectsToFile
  */
 public function testItSaveMetaDataObjectsToFile($metadataObjects, $expectedFileContent)
 {
     foreach ($metadataObjects as $metadata) {
         $this->index->addMetadata($metadata);
     }
     $path = $this->virtualDirectory->path() . '/somepath';
     $this->index->setSavePath(Stream::url($path));
     $this->assertSame($this->index, $this->index->save(array('test' => 'file')));
     $this->assertStringEqualsFile(Stream::url($path . '/index_test_file.php'), $expectedFileContent);
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:16,代码来源:IndexTest.php

示例4: testItRemovesAnOldSourceFileBeforeReCompiling

 public function testItRemovesAnOldSourceFileBeforeReCompiling()
 {
     $parser = $this->createParser('new Node()');
     // Pre-filling item that should be deleted
     mkdir(Stream::url($this->fileSystem->path() . '/compiled'));
     file_put_contents(Stream::url($this->fileSystem->path() . '/compiled/item_id_item2.php'), '<?php test file');
     // Source contains only one handle, so no additional handles should be created
     $source = $this->createSource(array('item1' => array('node' => array_fill(0, 4, array()))));
     $handleFilePaths = array('item1' => Stream::url($this->fileSystem->path() . '/compiled/item_id_item1.php'), 'item2' => Stream::url($this->fileSystem->path() . '/compiled/item_id_item2.php'));
     $metadata = $this->createMetadata($handleFilePaths, true);
     $newMetadata = $this->createMetadata(array_diff_key($handleFilePaths, array('item2' => null)), true);
     $this->metadataFactory->expects($this->once())->method('createFromSource')->with($this->identicalTo($source), array('item1'))->willReturn($newMetadata);
     $compiler = new Compiler($this->getCompilerOptions() + array('parsers' => array('node' => $parser)));
     $this->assertSame($newMetadata, $compiler->compile($source, $metadata));
     $this->assertStringEqualsFile($handleFilePaths['item1'], "<?php \$this->addItem(new Node());\n\$this->addItem(new Node());\n\$this->addItem(new Node());\n\$this->addItem(new Node());");
     $this->assertFileNotExists($handleFilePaths['item2']);
 }
开发者ID:albertobraschi,项目名称:EcomDev_LayoutCompiler,代码行数:17,代码来源:CompilerTest.php

示例5: buildNonS3PathProvider

 /**
  * @return array
  */
 public function buildNonS3PathProvider()
 {
     return array(array('/home/testUser/test', 'TestFile', '/home/testUser/test/TestFile'), array('/home/testUser/test', 'TestDir/NestedTestFile', '/home/testUser/test/TestDir/NestedTestFile'), array($this->root->path(), 'testfile1', $this->root->path() . DIRECTORY_SEPARATOR . 'testfile1'));
 }
开发者ID:fashionforhome,项目名称:s3fileshifter,代码行数:7,代码来源:PathHelperTest.php


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