DirectoryFetcherTest.php in Feeds 8.3
File
tests/src/Kernel/Feeds/Fetcher/DirectoryFetcherTest.php
View source
<?php
namespace Drupal\Tests\feeds\Kernel\Feeds\Fetcher;
use Drupal\Tests\feeds\Kernel\FeedsKernelTestBase;
class DirectoryFetcherTest extends FeedsKernelTestBase {
protected $feedType;
protected function setUp() {
parent::setUp();
$this->feedType = $this
->createFeedType([
'fetcher' => 'directory',
'fetcher_configuration' => [
'allowed_extensions' => 'atom rss rss1 rss2 opml xml',
],
]);
}
public function testImportSingleFile() {
$feed = $this
->createFeed($this->feedType
->id(), [
'source' => $this
->resourcesPath() . '/rss/googlenewstz.rss2',
]);
$feed
->import();
static::assertEquals(6, $feed
->getItemCount());
$this
->assertNodeCount(6);
}
}