You are here

protected function FeedsMapperTestCase::assertCCKFieldValue in Feeds 7

Same name and namespace in other branches
  1. 6 tests/feeds_mapper.test \FeedsMapperTestCase::assertCCKFieldValue()

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

Parameters

$field_name: The name of the CCK field.

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

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

See also

FeedsMapperTestCase::getFormFieldsNames()

FeedsMapperTestCase::getFormFieldsValues()

3 calls to FeedsMapperTestCase::assertCCKFieldValue()
FeedsMapperContentTestCase::test in tests/feeds_mapper_content.test
Basic test loading a doulbe entry CSV file.
FeedsMapperDateTestCase::test in tests/feeds_mapper_date.test
Basic test loading a single entry CSV file.
FeedsMapperLinkTestCase::test in tests/feeds_mapper_link.test
Basic test loading a single entry CSV file.

File

tests/feeds_mapper_test.inc, line 49
Helper class with auxiliary functions for feeds mapper module tests.

Class

FeedsMapperTestCase
Base class for implementing Feeds Mapper test cases.

Code

protected function assertCCKFieldValue($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,
    )));
  }
}