ItemListControllerTest.php in Feeds 8.3
File
tests/src/Functional/Controller/ItemListControllerTest.php
View source
<?php
namespace Drupal\Tests\feeds\Functional\Controller;
use Drupal\Tests\feeds\Functional\FeedsBrowserTestBase;
class ItemListControllerTest extends FeedsBrowserTestBase {
public static $modules = [
'entity_test',
'feeds',
'feeds_test_entity',
];
public function testListItemsForAnEntityTypeWithoutLinkTemplate() {
$feed_type = $this
->createFeedType([
'parser' => 'csv',
'processor' => 'entity:feeds_test_entity_test_no_links',
'processor_configuration' => [
'authorize' => FALSE,
],
'custom_sources' => [
'title' => [
'label' => 'title',
'value' => 'title',
'machine_name' => 'title',
],
],
'mappings' => [
[
'target' => 'name',
'map' => [
'value' => 'title',
],
],
],
]);
$feed = $this
->createFeed($feed_type
->id(), [
'source' => $this
->resourcesUrl() . '/csv/content.csv',
]);
$feed
->import();
$this
->drupalGet('/feed/1/list');
$this
->assertNoText('The website encountered an unexpected error.');
$this
->assertText('Lorem ipsum');
$this
->assertText('Ut wisi enim ad minim veniam');
}
}