You are here

protected function TitleTranslationTestCase::checkFieldValues in Title 7

Checks the field values.

Checks that the field values and optionally the legacy ones match the given values.

2 calls to TitleTranslationTestCase::checkFieldValues()
TitleTranslationTestCase::testFormTranslationWorkflow in tests/TitleTranslationTestCase.test
Tests taxonomy form translation workflow.
TitleTranslationTestCase::testProgrammaticTranslationWorkflow in tests/TitleTranslationTestCase.test
Tests taxonomy programmatic translation workflow.

File

tests/TitleTranslationTestCase.test, line 271

Class

TitleTranslationTestCase
Tests for legacy field replacement.

Code

protected function checkFieldValues($term, $values, $langcode, $legacy_match = TRUE) {
  foreach ($values as $name => $value) {
    $field_value = $term->{$name . '_field'}[$langcode][0]['value'];
    if ($field_value != $value || $legacy_match !== ($field_value == $term->{$name})) {
      return FALSE;
    }
  }
  return TRUE;
}