You are here

protected function FeedsJavascriptTestBase::mappingSetTargetConfiguration in Feeds 8.3

Sets target configuration for a mapper.

Parameters

int $i: The row number on the mapping form.

array $settings: The settings to set.

2 calls to FeedsJavascriptTestBase::mappingSetTargetConfiguration()
FeedsJavascriptTestBase::addMappings in tests/src/FunctionalJavascript/FeedsJavascriptTestBase.php
Adds mappings to the given feed type via the UI.
MappingFormTest::testSetMultipleMappingsWithCustomSources in tests/src/FunctionalJavascript/Form/MappingFormTest.php
Tests that multiple new CSV sources can be defined without errors.

File

tests/src/FunctionalJavascript/FeedsJavascriptTestBase.php, line 224

Class

FeedsJavascriptTestBase
Base class for Feeds javascript tests.

Namespace

Drupal\Tests\feeds\FunctionalJavascript

Code

protected function mappingSetTargetConfiguration($i, array $settings) {
  $page = $this
    ->getSession()
    ->getPage();
  $assert_session = $this
    ->assertSession();

  // Open the settings form for the the target.
  $target_settings = $page
    ->find('css', 'input[name="target-settings-' . $i . '"]');
  $target_settings
    ->click();
  $assert_session
    ->assertWaitOnAjaxRequest();

  // Set target configuration values.
  foreach ($settings as $settings_key => $settings_value) {
    $target_settings_field = $page
      ->findField('mappings[' . $i . '][settings][' . $settings_key . ']');
    $target_settings_field
      ->setValue($settings_value);
  }

  // Update configuration.
  $page
    ->findButton('Update')
    ->click();
  $assert_session
    ->assertWaitOnAjaxRequest();
}