本文整理汇总了PHP中org\bovigo\vfs\vfsStreamWrapper::setRoot方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStreamWrapper::setRoot方法的具体用法?PHP vfsStreamWrapper::setRoot怎么用?PHP vfsStreamWrapper::setRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org\bovigo\vfs\vfsStreamWrapper
的用法示例。
在下文中一共展示了vfsStreamWrapper::setRoot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
示例2: setUp
public function setUp()
{
$this->rootDir = new vfsStreamDirectory('queries');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot($this->rootDir);
$this->loader = new FilesystemQueryLoader($this->rootDir->url());
}
示例3: discard
/**
* Discards VFS file system changes
*
* @return EcomDev_PHPUnit_Model_Fixture_Vfs
*/
public function discard()
{
if ($this->_currentRoot) {
StreamWrapper::setRoot(array_pop($this->_currentRoot));
}
return $this;
}
示例4: setUp
protected function setUp()
{
parent::setUp();
vfsStreamWrapper::register();
$this->vfs = new vfsStreamDirectory('chunks');
vfsStreamWrapper::setRoot($this->vfs);
}
示例5: setUp
public function setUp()
{
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('logs'));
$this->key = 'Logger\\Default';
$this->factory = new LoggerFactory();
}
示例6: 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'));
}
示例7: 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']);
}
示例8: setFileSystem
protected function setFileSystem()
{
vfsStreamWrapper::register();
$root = vfsStream::newDirectory('build');
vfsStreamWrapper::setRoot($root);
return $root;
}
示例9: testCacheWSDLIsWorldWritable
public function testCacheWSDLIsWorldWritable()
{
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('tmp'));
$SOAP = $this->getMock('SSRS\\Soap\\NTLM', array('setCacheWSDLPermission'), array('http://'));
$SOAP->expects($this->once())->method('setCacheWSDLPermission')->with($this->equalTo(0666));
$SOAP->setCachePath(vfsStream::url('tmp/file.wsdl'))->cacheWSDL('$fileContents');
}
示例10: initSchemaManager
/**
* PHPUnit cannot add this to code coverage
*
* @codeCoverageIgnore
*
* @param $swaggerPath
*
* @throws \org\bovigo\vfs\vfsStreamException
*/
public static function initSchemaManager($swaggerPath)
{
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
file_put_contents(vfsStream::url('root') . '/swagger.json', json_encode(Yaml::parse(file_get_contents($swaggerPath))));
self::$schemaManager = new SchemaManager(vfsStream::url('root') . '/swagger.json');
self::$document = new SwaggerDocument($swaggerPath);
}
示例11: setUp
public function setUp()
{
$this->buildDir = new vfsStreamDirectory('build');
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot($this->buildDir);
$this->filesystem = m::mock('Symfony\\Component\\Filesystem\\Filesystem');
$this->application = new Application($this->getMockKernel());
}
示例12: setUp
public function setUp()
{
vfsStreamWrapper::register();
$root = new vfsStreamDirectory('root');
vfsStreamWrapper::setRoot($root);
vfsStream::copyFromFileSystem(__DIR__ . '/../package');
$this->config = ['version' => '1.0.4', 'configFile' => vfsStream::url('root/app/code/community/Slovenian/LocalePackSl/etc/config.xml'), 'packageFile' => vfsStream::url('root/package.xml')];
}
示例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->csv = new Csv();
$this->largeCsv = realpath(__DIR__ . "/../../../data/Large.csv");
$this->smallCsv = realpath(__DIR__ . "/../../../data/Small.csv");
vfsStreamWrapper::register();
vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
}
示例14: 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();
}
示例15: 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);
}