$this->
submitForm([], 'Update translations'
);
// Check if the translation has been updated, using the status cache.
$status =
locale_translation_get_status();
$this->
assertEquals(LOCALE_TRANSLATION_CURRENT,
$status['contrib_module_one'
]['de'
]->type, 'Translation of contrib_module_one found'
);
$this->
assertEquals(LOCALE_TRANSLATION_CURRENT,
$status['contrib_module_two'
]['de'
]->type, 'Translation of contrib_module_two found'
);
$this->
assertEquals(LOCALE_TRANSLATION_CURRENT,
$status['contrib_module_three'
]['de'
]->type, 'Translation of contrib_module_three found'
);
// Check the new translation status.
// The static cache needs to be flushed first to get the most recent data
// from the database. The function was called earlier during this test.
drupal_static_reset('locale_translation_get_file_history'
);
$history =
locale_translation_get_file_history();
// Verify that the translation of contrib_module_one is imported and
// updated.
$this->
assertGreaterThanOrEqual($this->timestampNow,
$history['contrib_module_one'
]['de'
]->timestamp
);
$this->
assertGreaterThanOrEqual($this->timestampNow,
$history['contrib_module_one'
]['de'
]->last_checked
);
$this->
assertEquals($this->timestampNew,
$history['contrib_module_two'
]['de'
]->timestamp, 'Translation of contrib_module_two is imported'
);
// Verify that the translation of contrib_module_two is updated.
$this->
assertGreaterThanOrEqual($this->timestampNow,
$history['contrib_module_two'
]['de'
]->last_checked
);
$this->
assertEquals($this->timestampMedium,
$history['contrib_module_three'
]['de'
]->timestamp, 'Translation of contrib_module_three is not imported'
);
$this->
assertEquals($this->timestampMedium,
$history['contrib_module_three'
]['de'
]->last_checked, 'Translation of contrib_module_three is not updated'
);