/**
  *
  * @dataProvider dataProviderTestFetchFolderInfoIfFolderElementAvailable
  *
  * @param string $pageHtml
  * @param string $folderName
  * @param FshareFile[] $files
  */
 public function testFetchFolderInfoIfFolderElementAvailable($pageHtml, $folderName, $files)
 {
     $folderUrl = 'http://dummy.url';
     $request = new Request('GET', $folderUrl);
     $this->clientMock->expects(static::once())->method('send')->with($request)->willReturn(new Response(200, [], $pageHtml));
     $this->requestDecoratorMock->expects(static::once())->method('decorate')->willReturnArgument(0);
     $folderInfo = $this->testObject->fetchFolderInfo($folderUrl);
     static::assertEquals($folderUrl, $folderInfo->getUrl());
     static::assertEquals($folderName, $folderInfo->getName());
     static::assertEquals($files, $folderInfo->getFiles());
 }
 public function testFetchFolderInfo()
 {
     $folderFetcher = new HtmlBasedFolderFetcher(new Client(['cookies' => new CookieJar()]), new ReferralRequestDecorator());
     $folderInfo = $folderFetcher->fetchFolderInfo(FSHARE_TEST_FOLDER_URL);
     $files = $folderInfo->getFiles();
     $maxFileIndex = count($files) - 1;
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_NAME, $folderInfo->getName());
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_NUMBER_OF_FILES, count($files));
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_FIRST_FILE_URL, $files[0]->getUrl());
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_FIRST_FILE_NAME, $files[0]->getName());
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_LAST_FILE_URL, $files[$maxFileIndex]->getUrl());
     static::assertEquals(FSHARE_TEST_FOLDER_EXPECTED_LAST_FILE_NAME, $files[$maxFileIndex]->getName());
 }