You are here

protected function FeedsItemFormatterTestBase::createCsvFeed in Feeds 8.3

Creates a feed type and feed using the CSV parser.

Return value

\Drupal\feeds\FeedInterface The created feed, with a CSV source already set.

8 calls to FeedsItemFormatterTestBase::createCsvFeed()
FeedsItemGuidFormatterTest::testFeedsItemGuidFormatter in tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemGuidFormatterTest.php
Test the feeds item guid formatter.
FeedsItemImportedFormatterTest::testFeedsItemImportedFormatter in tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemImportedFormatterTest.php
Test the feeds item imported formatter.
FeedsItemTargetEntityFormatterTest::testFeedsItemTargetEntityFormatter in tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemTargetEntityFormatterTest.php
Tests the feeds target entity view formatter.
FeedsItemTargetIdFormatterTest::testFeedsItemTargetIdFormatter in tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemTargetIdFormatterTest.php
Tests the feeds target id formatter.
FeedsItemTargetLabelFormatterTest::testFeedsItemTargetLabelFormatterLink in tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemTargetLabelFormatterTest.php
Tests the feeds target label formatter as a link.

... See full list

File

tests/src/Functional/Plugin/Field/FieldFormatter/FeedsItemFormatterTestBase.php, line 45

Class

FeedsItemFormatterTestBase
Base class for the feeds item field formatter tests.

Namespace

Drupal\Tests\feeds\Functional\Plugin\Field\FieldFormatter

Code

protected function createCsvFeed() {
  $feed_type = $this
    ->createFeedTypeForCsv([
    'guid',
    'title',
  ], [
    'mappings' => array_merge($this
      ->getDefaultMappings(), [
      [
        'target' => 'feeds_item',
        'map' => [
          'guid' => 'guid',
          'url' => 'url',
        ],
      ],
    ]),
  ]);

  // Create a feed for the article to belong to.
  $feed = $this
    ->createFeed($feed_type
    ->id(), [
    'source' => $this
      ->resourcesPath() . '/csv/content.csv',
  ]);
  return $feed;
}