You are here

protected function FeedsMapperTestBase::assertNodeFieldValue in Feeds 8.2

Assert that a form field for the given field with the given value exists in the current form.

Parameters

$field_name: The name of the field.

$value: The (raw) value expected for the field.

$index: The index of the field (for q multi-valued field).

See also

FeedsMapperTestBase::getFormFieldsNames()

FeedsMapperTestBase::getFormFieldsValues()

3 calls to FeedsMapperTestBase::assertNodeFieldValue()
FeedsMapperDateTest::test in lib/Drupal/feeds/Tests/FeedsMapperDateTest.php
Basic test loading a single entry CSV file.
FeedsMapperFieldTest::test in lib/Drupal/feeds/Tests/FeedsMapperFieldTest.php
Basic test loading a double entry CSV file.
FeedsMapperLinkTest::test in lib/Drupal/feeds/Tests/FeedsMapperLinkTest.php
Basic test loading a single entry CSV file.

File

lib/Drupal/feeds/Tests/FeedsMapperTestBase.php, line 46
Helper class with auxiliary functions for feeds mapper module tests.

Class

FeedsMapperTestBase
Base class for implementing Feeds Mapper test cases.

Namespace

Drupal\feeds\Tests

Code

protected function assertNodeFieldValue($field_name, $value, $index = 0) {
  $names = $this
    ->getFormFieldsNames($field_name, $index);
  $values = $this
    ->getFormFieldsValues($field_name, $value);
  foreach ($names as $k => $name) {
    $value = $values[$k];
    $this
      ->assertFieldByName($name, $value, t('Found form field %name for %field_name with the expected value.', array(
      '%name' => $name,
      '%field_name' => $field_name,
    )));
  }
}