You are here

protected function SkipNewTest::createFeedTypeForThisTest in Feeds 8.3

Creates a feed type used by several tests in this class.

Parameters

array $processor_configuration: (optional) The processor configuration.

3 calls to SkipNewTest::createFeedTypeForThisTest()
SkipNewTest::testSkipNewAndSkipExisting in tests/src/Kernel/SkipNewTest.php
Tests skip new items without update existing as well.
SkipNewTest::testSkipNewAndUpdateExisting in tests/src/Kernel/SkipNewTest.php
Tests skip new items with update existing.
SkipNewTest::testSkipNewItems in tests/src/Kernel/SkipNewTest.php
Tests skip new items when there are no nodes yet.

File

tests/src/Kernel/SkipNewTest.php, line 57

Class

SkipNewTest
Tests the feature of creating/skipping new items.

Namespace

Drupal\Tests\feeds\Kernel

Code

protected function createFeedTypeForThisTest(array $processor_configuration = []) {

  // Create a feed type and set the title as unique target.
  return $this
    ->createFeedType([
    'fetcher' => 'directory',
    'fetcher_configuration' => [
      'allowed_extensions' => 'rss2',
    ],
    'processor_configuration' => $processor_configuration + [
      'authorize' => FALSE,
      'values' => [
        'type' => 'article',
      ],
    ],
    'mappings' => [
      [
        'target' => 'title',
        'map' => [
          'value' => 'title',
        ],
        'unique' => [
          'value' => TRUE,
        ],
        'settings' => [
          'language' => NULL,
        ],
      ],
      [
        'target' => 'body',
        'map' => [
          'value' => 'description',
        ],
        'settings' => [
          'format' => 'plain_text',
          'language' => NULL,
        ],
      ],
    ],
  ]);
}