You are here

protected function FieldTest::checkValues in Feeds 8.3

Checks the field values.

Parameters

array $expected_values_per_node: The expected field values, per node ID.

2 calls to FieldTest::checkValues()
FieldTest::test in tests/src/Kernel/Feeds/Target/FieldTest.php
Basic test loading a double entry CSV file.
FieldTest::testClearOutValues in tests/src/Kernel/Feeds/Target/FieldTest.php
Tests if values are cleared out when an empty value is provided.

File

tests/src/Kernel/Feeds/Target/FieldTest.php, line 391

Class

FieldTest
Tests for mapping to text and numeric fields.

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Target

Code

protected function checkValues(array $expected_values_per_node) {
  foreach ($expected_values_per_node as $node_id => $expected_values) {
    $node = Node::load($node_id);
    foreach ($expected_values as $field_name => $value) {
      $this
        ->assertEquals($value, $node->{$field_name}->value);
    }
  }
}