1 field.test | private FieldTranslationsTestCase::checkTranslationRevisions($eid, $evid, $available_languages) |
Check if the field translation attached to the entity revision identified by the passed arguments were correctly stored.
File
- core/
modules/ field/ tests/ field.test, line 3199 - Tests for field.module.
Class
- FieldTranslationsTestCase
- Unit test class for the multilanguage fields logic.
Code
private function checkTranslationRevisions($eid, $evid, $available_languages) {
$field_name = $this->field['field_name'];
$entity = field_test_entity_test_load($eid, $evid);
foreach ($available_languages as $langcode => $value) {
$passed = isset($entity->{$field_name}[$langcode]) && $entity->{$field_name}[$langcode][0]['value'] == $value + 1;
$this->assertTrue($passed, format_string('The @language translation for revision @revision was correctly stored', array('@language' => $langcode, '@revision' => $entity->ftvid)));
}
}