You are here

public function DirectoryFetcherTest::testEmptyDirectory in Feeds 8.3

Tests fetching an empty directory.

@covers ::fetch

File

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

Class

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

Namespace

Drupal\Tests\feeds\Unit\Feeds\Fetcher

Code

public function testEmptyDirectory() {
  mkdir('vfs://feeds/emptydir');
  $feed = $this
    ->createMock('Drupal\\feeds\\FeedInterface');
  $feed
    ->expects($this
    ->any())
    ->method('getSource')
    ->will($this
    ->returnValue('vfs://feeds/emptydir'));
  $this
    ->expectException(EmptyFeedException::class);
  $result = $this->fetcher
    ->fetch($feed, $this->state);
}