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


PHP vfsStreamDirectory::getChildren方法代碼示例

本文整理匯總了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());
 }
開發者ID:fashionforhome,項目名稱:s3fileshifter,代碼行數:7,代碼來源:DefaultDeleteTest.php

示例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'));
 }
開發者ID:fashionforhome,項目名稱:s3fileshifter,代碼行數:7,代碼來源:DefaultShiftTest.php

示例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());
 }
開發者ID:sirdiego,項目名稱:importr,代碼行數:20,代碼來源:RenameFileTest.php

示例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];
 }
開發者ID:newup,項目名稱:core,代碼行數:11,代碼來源:FilesystemVirtualization.php


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