You are here

public function DirectoryFetcherTest::testFetchFile in Feeds 8.3

Tests fetching a file.

@covers ::fetch

File

tests/src/Unit/Feeds/Fetcher/DirectoryFetcherTest.php, line 74

Class

DirectoryFetcherTest
@coversDefaultClass \Drupal\feeds\Feeds\Fetcher\DirectoryFetcher @group feeds

Namespace

Drupal\Tests\feeds\Unit\Feeds\Fetcher

Code

public function testFetchFile() {
  $feed = $this
    ->createMock('Drupal\\feeds\\FeedInterface');
  $feed
    ->expects($this
    ->any())
    ->method('getSource')
    ->will($this
    ->returnValue('vfs://feeds/test_file_1.txt'));
  $result = $this->fetcher
    ->fetch($feed, $this->state);
  $this
    ->assertSame('vfs://feeds/test_file_1.txt', $result
    ->getFilePath());
}