You are here

public function FeedsFetcherResultTest::testGetFileContents in Feeds 7.2

@covers FeedsFetcherResult::getFileContents().

File

tests/FeedsFetcherResultTest.test, line 169

Class

FeedsFetcherResultTest
@coversDefaultClass FeedsFetcherResult @group feeds

Code

public function testGetFileContents() {

  // Save raw data to a file.
  $this->fetcherResult
    ->saveRawToFile();

  // Overwrite data of file.
  $new_raw = $this
    ->randomString();
  $file_path = $this->fetcherResult
    ->getFilePath();
  file_put_contents($file_path, $new_raw);

  // Assert that the expected raw data is returned.
  $this
    ->assertEqual($new_raw, $this->fetcherResult
    ->getFileContents());
}