You are here

public function MappingFormTest::testPluginWithMappingForm in Feeds 8.3

Tests that plugins can alter the mapping form.

File

tests/src/Functional/Form/MappingFormTest.php, line 55

Class

MappingFormTest
@coversDefaultClass \Drupal\feeds\Form\MappingForm @group feeds

Namespace

Drupal\Tests\feeds\Functional\Form

Code

public function testPluginWithMappingForm() {
  $feed_type = $this
    ->createFeedType([
    'parser' => 'parser_with_mapping_form',
  ]);
  $edit = [
    'dummy' => 'dummyValue',
  ];
  $this
    ->drupalPostForm('/admin/structure/feeds/manage/' . $feed_type
    ->id() . '/mapping', $edit, 'Save');

  // Assert that the dummy value was saved for the parser.
  $feed_type = $this
    ->reloadEntity($feed_type);
  $config = $feed_type
    ->getParser()
    ->getConfiguration();
  $this
    ->assertEquals('dummyValue', $config['dummy']);
}