本文整理汇总了PHP中org\bovigo\vfs\vfsStreamDirectory::getChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStreamDirectory::getChildren方法的具体用法?PHP vfsStreamDirectory::getChildren怎么用?PHP vfsStreamDirectory::getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org\bovigo\vfs\vfsStreamDirectory
的用法示例。
在下文中一共展示了vfsStreamDirectory::getChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testShouldBeAbleToDeleteExistingFile
public function testShouldBeAbleToDeleteExistingFile()
{
$localDelete = new DefaultDelete($this->root->url() . '/testfile1');
$localDelete->execute();
$this->assertEquals(1, count($this->root->getChildren()));
$this->assertEquals('testfile2', $this->root->getChildren()[0]->getName());
}
示例2: testFileIsNotOnSourceAfterShift
public function testFileIsNotOnSourceAfterShift()
{
$copy = new DefaultShift($this->root->url() . '/testfile1', $this->root->url() . '/testfile1Shifted');
$copy->execute();
$this->assertEquals(2, count($this->root->getChildren()));
$this->assertNull($this->root->getChild('testfile1'));
}
示例3: does_execute_rename_file_when_configured
/**
* @test
*/
public function does_execute_rename_file_when_configured()
{
$manager = $this->getMock(ManagerInterface::class);
$strategy = $this->getMock(Strategy::class);
$strategy->expects($this->once())->method('getConfiguration')->will($this->returnValue(['after' => ['rename' => true]]));
$import = $this->getMock(Import::class);
$import->expects($this->once())->method('getStrategy')->will($this->returnValue($strategy));
$file = vfsStream::newFile('import.csv')->at($this->root)->setContent("test;test");
$oldFileName = $file->getName();
$this->fileService->expects($this->any())->method('getFileAbsFileName')->will($this->returnCallback(function () use($file) {
return $file->url();
}));
$this->fixture->execute($manager, $import);
$children = $this->root->getChildren();
$this->assertEquals(1, sizeof($children));
$this->assertRegExp('/^[0-9]{14}_' . $oldFileName . '$/', $children[0]->getName());
}
示例4: getFileAtIndex
/**
* Gets a virtual file at a specified index.
*
* @param $index
*
* @return \org\bovigo\vfs\vfsStreamContent
*/
public function getFileAtIndex($index)
{
return $this->vfs->getChildren()[$index];
}