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


PHP vfsStreamDirectory::url方法代碼示例

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


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

示例1:

 function it_throws_an_exception_if_settings_schema_does_not_exist(ThemeInterface $theme)
 {
     $theme->getTitle()->willReturn('Candy shop');
     $theme->getName()->willReturn('candy/shop');
     $theme->getPath()->willReturn($this->vfsStream->url());
     $this->shouldThrow(new \InvalidArgumentException(sprintf('Could not find settings schema of theme "Candy shop" (candy/shop) in file "%s"', $this->vfsStream->url() . '/Settings.php')))->during('getSchema', [$theme]);
 }
開發者ID:ReissClothing,項目名稱:Sylius,代碼行數:7,代碼來源:ThemeSettingsSchemaProviderSpec.php

示例2: testCreate_WhenPatternHasLastOnFile_ThrowsException

 public function testCreate_WhenPatternHasLastOnFile_ThrowsException()
 {
     vfsStream::newFile('file.csv')->at($this->root);
     $pathToFile = $this->root->url() . '/file.csv';
     $this->setExpectedException('\\InvalidArgumentException');
     $this->getFileNameGenerator($pathToFile . ':last')->getGeneratedFileName();
 }
開發者ID:nikoms,項目名稱:phpunit-fail-lover,代碼行數:7,代碼來源:FileNameGeneratorTest.php

示例3: 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

示例4: setUp

 public function setUp()
 {
     $this->rootDir = new vfsStreamDirectory('queries');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot($this->rootDir);
     $this->loader = new FilesystemQueryLoader($this->rootDir->url());
 }
開發者ID:cocur,項目名稱:nqm,代碼行數:7,代碼來源:FilesystemTest.php

示例5: shouldUpdateVersionInEmConf

 /**
  * @test
  */
 public function shouldUpdateVersionInEmConf()
 {
     $service = new EmConfService($this->root->url(), 'extension_manager');
     $service->updateVersion('47.11.4711');
     $service->write();
     $this->assertRegExp('~\'version\' => \'47\\.11\\.4711\'~', $this->emConf->getContent());
 }
開發者ID:AOEpeople,項目名稱:TYPO3-CLI-Tools,代碼行數:10,代碼來源:EmConfServiceTest.php

示例6: testNonExistent

 public function testNonExistent()
 {
     $url = $this->_root->url() . '/test';
     $validator = new DirectoryWritable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(array(DirectoryWritable::DIRECTORY => "'{$url}' ist kein Verzeichnis oder nicht zugänglich"), $validator->getMessages());
 }
開發者ID:patrickpreuss,項目名稱:Braintacle,代碼行數:7,代碼來源:DirectoryWritableTest.php

示例7: testShouldThrowExceptionWhenDeletionNotPermitted

 /**
  * @expectedException RuntimeException
  */
 public function testShouldThrowExceptionWhenDeletionNotPermitted()
 {
     $this->root->chmod(0555);
     $this->root->getChild('testfile2')->chmod(0555);
     $localDelete = new DefaultDelete($this->root->url() . '/testfile2');
     $localDelete->execute();
 }
開發者ID:fashionforhome,項目名稱:s3fileshifter,代碼行數:10,代碼來源:DefaultDeleteTest.php

示例8: testNonExistent

 public function testNonExistent()
 {
     $url = $this->_root->url() . '/test';
     $validator = new FileReadable();
     $this->assertFalse($validator->isValid($url));
     $this->assertEquals(array(FileReadable::FILE => "'{$url}' ist keine Datei oder nicht zugänglich"), $validator->getMessages());
 }
開發者ID:patrickpreuss,項目名稱:Braintacle,代碼行數:7,代碼來源:FileReadableTest.php

示例9: testFustyRequest_ValidateUpload

 /**
  */
 public function testFustyRequest_ValidateUpload()
 {
     //// Setup test
     $firstChunk = vfsStream::newFile('temp_file');
     $firstChunk->setContent('1234567890');
     $this->vfs->addChild($firstChunk);
     $fileInfo = new \ArrayObject(array('size' => 10, 'error' => UPLOAD_ERR_OK, 'tmp_name' => $firstChunk->url()));
     $request = new \ArrayObject(array('flowIdentifier' => '13632-prettifyjs', 'flowFilename' => 'prettify.js', 'flowRelativePath' => 'home/prettify.js'));
     $fustyRequest = new FustyRequest($request, $fileInfo);
     $config = new Config();
     $config->setTempDir($this->vfs->url());
     /** @var File $file */
     $file = $this->getMock('Flow\\File', array('_move_uploaded_file'), array($config, $fustyRequest));
     /** @noinspection PhpUndefinedMethodInspection */
     $file->expects($this->once())->method('_move_uploaded_file')->will($this->returnCallback(function ($filename, $destination) {
         return rename($filename, $destination);
     }));
     //// Actual test
     $this->assertTrue($file->validateChunk());
     $this->assertFalse($file->validateFile());
     $this->assertTrue($file->saveChunk());
     $this->assertTrue($file->validateFile());
     $path = $this->vfs->url() . DIRECTORY_SEPARATOR . 'new';
     $this->assertTrue($file->save($path));
     $this->assertEquals(10, filesize($path));
 }
開發者ID:watonyweng,項目名稱:flowjs-tour,代碼行數:28,代碼來源:FustyRequestTest.php

示例10: testCreateTmpDir

 public function testCreateTmpDir()
 {
     $workingDirectory = $this->workingDirectoryFactory->createTmpDir(array(), array());
     $workingDirectoryPath = $workingDirectory->getPath();
     $this->assertNotEquals($this->storageDir->url(), $workingDirectoryPath);
     $this->assertEquals($this->storageDir->url(), dirname($workingDirectoryPath));
     $this->assertNotEmpty(basename($workingDirectoryPath));
 }
開發者ID:TomzxForks,項目名稱:melody,代碼行數:8,代碼來源:WorkingDirectoryFactoryTest.php

示例11: setUp

 protected function setUp()
 {
     $this->root = new vfsStreamDirectory('test');
     vfsStreamWrapper::register();
     vfsStreamWrapper::setRoot($this->root);
     $this->responder = new StaticHtmlFileResponder($this->root->url(), 'file');
     $this->response = new Response();
 }
開發者ID:bitexpert,項目名稱:adrenaline,代碼行數:8,代碼來源:StaticHtmlFileResponderUnitTest.php

示例12: testItLoadsMetaDataObjectsFromFile

 /**
  * @param $fileContent
  * @param $expectedMetadataObjects
  * @param $expectedMetadataHandleObjects
  * 
  * @dataProvider dataProviderMetadataObjectsFromFile
  */
 public function testItLoadsMetaDataObjectsFromFile($fileContent, $expectedMetadataObjects, $expectedMetadataHandleObjects)
 {
     Stream::create(array('index_test_file.php' => $fileContent), $this->virtualDirectory);
     $this->index->setSavePath($this->virtualDirectory->url());
     $this->assertTrue($this->index->load(array('test' => 'file')));
     $this->assertAttributeEquals($expectedMetadataObjects, 'metadata', $this->index);
     $this->assertAttributeEquals($expectedMetadataHandleObjects, 'metadataByHandle', $this->index);
 }
開發者ID:albertobraschi,項目名稱:EcomDev_LayoutCompiler,代碼行數:15,代碼來源:IndexTest.php

示例13: pathToUrl

 protected function pathToUrl($path = '')
 {
     //@todo Consider adding hasChild() test and throw exception if test fails?
     if ($this->root->hasChild(ltrim($path, '/'))) {
         return $this->root->getChild(ltrim($path, '/'))->url();
     }
     return $this->root->url() . $path;
 }
開發者ID:wackamole0,項目名稱:rainmaker-tool,代碼行數:8,代碼來源:FilesystemMock.php

示例14: createTestProject

 protected function createTestProject()
 {
     $testDir = self::$tmpName = tempnam(self::$root->url(), '');
     unlink($testDir);
     mkdir($testDir);
     file_put_contents($testDir . '/' . Config::PLATFORM_CONFIG, 'name: phpunit');
     chdir($testDir);
 }
開發者ID:mglaman,項目名稱:platform-docker,代碼行數:8,代碼來源:BaseUtilsTest.php

示例15: testOutputDirNotFound

 public function testOutputDirNotFound()
 {
     $dir = $this->output_dir->url('thumbs');
     $service = new ImageService($this->imanee, $this->source_dir, $dir . '/test', new Filesystem());
     // test a valid resource
     $thumbnail = $service->thumbnail('valid.jpg', 100, 100, false);
     $this->assertContains('-100x100.jpeg', $thumbnail);
 }
開發者ID:helios-ag,項目名稱:icelus,代碼行數:8,代碼來源:ImageServiceTest.php


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