本文整理汇总了PHP中org\bovigo\vfs\vfsStreamWrapper::register方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStreamWrapper::register方法的具体用法?PHP vfsStreamWrapper::register怎么用?PHP vfsStreamWrapper::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org\bovigo\vfs\vfsStreamWrapper
的用法示例。
在下文中一共展示了vfsStreamWrapper::register方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFileSystem
protected function setFileSystem()
{
vfsStreamWrapper::register();
$root = vfsStream::newDirectory('build');
vfsStreamWrapper::setRoot($root);
return $root;
}
示例2: setUp
/**
* Sets up the test fixture.
*
* @return void
*/
public function setUp()
{
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('test'));
$this->forum = 'test';
$this->contents = new Forum_Contents(vfsStream::url('test'));
}
示例3: setUp
public function setUp()
{
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('logs'));
$this->key = 'Logger\\Default';
$this->factory = new LoggerFactory();
}
示例4: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->fileHandler = new FileHandlerPhp();
vfsStreamWrapper::register();
try {
$testPath = $this->getTestPath();
// Remove the files
foreach ($this->resourcesToRemove as $path) {
$fullPath = $testPath . $path;
if (is_file($fullPath)) {
unlink($fullPath);
}
}
// Remove the directories
foreach ($this->resourcesToRemove as $path) {
$fullPath = $testPath . $path;
if (is_dir($fullPath)) {
rmdir($fullPath);
}
}
} catch (\PHPUnit_Framework_SkippedTestError $e) {
} catch (\PHPUnit_Framework_AssertionFailedError $e) {
}
}
示例5: setUp
public function setUp()
{
vfsStreamWrapper::register();
$root = vfsStream::setup('logs');
$mockFile = vfsStream::newFile('logging_helper.log')->at($root);
$root->addChild($mockFile);
}
示例6: setUp
public function setUp()
{
$this->rootDir = new vfsStreamDirectory('queries');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot($this->rootDir);
$this->loader = new FilesystemQueryLoader($this->rootDir->url());
}
示例7: setUp
public function setUp()
{
$this->controllerCollection = \Mockery::mock("Silex\\ContainerCollection");
$this->app = \Mockery::mock("Silex\\Application");
$this->securityContainer = \Mockery::mock("Silktide\\LazyBoy\\Security\\SecurityContainer");
vfsStreamWrapper::register();
}
示例8: setUp
protected function setUp()
{
parent::setUp();
vfsStreamWrapper::register();
$this->vfs = new vfsStreamDirectory('chunks');
vfsStreamWrapper::setRoot($this->vfs);
}
示例9: testDiscovery
/**
* Tests the YAML file discovery.
*/
public function testDiscovery()
{
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('modules');
vfsStreamWrapper::setRoot($root);
$url = vfsStream::url('modules');
mkdir($url . '/test_1');
file_put_contents($url . '/test_1/test_1.test.yml', 'name: test');
file_put_contents($url . '/test_1/test_2.test.yml', 'name: test');
mkdir($url . '/test_2');
file_put_contents($url . '/test_2/test_3.test.yml', 'name: test');
// Write an empty YAML file.
file_put_contents($url . '/test_2/test_4.test.yml', '');
// Set up the directories to search.
$directories = array('test_1' => $url . '/test_1', 'test_2' => $url . '/test_1', 'test_3' => $url . '/test_2', 'test_4' => $url . '/test_2');
$discovery = new YamlDiscovery('test', $directories);
$data = $discovery->findAll();
$this->assertEquals(count($data), count($directories));
$this->assertArrayHasKey('test_1', $data);
$this->assertArrayHasKey('test_2', $data);
$this->assertArrayHasKey('test_3', $data);
$this->assertArrayHasKey('test_4', $data);
foreach (array('test_1', 'test_2', 'test_3') as $key) {
$this->assertArrayHasKey('name', $data[$key]);
$this->assertEquals($data[$key]['name'], 'test');
}
$this->assertSame(array(), $data['test_4']);
}
示例10: getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory
/**
* @test
* @expectedException \Neos\FluidAdaptor\View\Exception\InvalidTemplateResourceException
*/
public function getPartialPathAndFilenameThrowsExceptionIfPartialFileIsADirectory()
{
vfsStreamWrapper::register();
mkdir('vfs://MyPartials/NotAFile');
$this->standaloneView->setPartialRootPath('vfs://MyPartials');
$this->standaloneView->getTemplatePaths()->getPartialSource('NotAFile');
}
示例11: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->ini = new Ini();
$this->filename = realpath(__DIR__ . "/../../../data/test.ini");
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
}
示例12: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->csv = new Csv();
$this->largeCsv = realpath(__DIR__ . "/../../../data/Large.csv");
$this->smallCsv = realpath(__DIR__ . "/../../../data/Small.csv");
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
}
示例13: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new NlReader();
vfsStreamWrapper::register();
$root = vfsStream::newDirectory('tmp');
vfsStreamWrapper::setRoot($root);
$this->file = vfsStream::newFile('items.csv', 0764)->withContent("73-ou-XW46\nApple\n1\na")->at($root);
}
示例14: setUp
/**
* Sets up this testcase
*
* @return void
*/
protected function setUp()
{
if (!class_exists('org\\bovigo\\vfs\\vfsStreamWrapper')) {
$this->markTestSkipped('File backend tests are not available with this phpunit version.');
}
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('Foo'));
}
示例15: tearDownCacheDir
public function tearDownCacheDir()
{
vfsStreamWrapper::register();
$cacheDir = vfsStream::url('zf2-module-test');
if (is_dir($cacheDir)) {
static::rmdir($cacheDir);
}
}