Update a pre-existing file.
function testBulkImportUpdateExisting() {
$langcode = 'de';
// Translations should not exist.
$strings = array(
'Monday' => '',
'Tuesday' => '',
);
$this
->checkTranslations($strings, $langcode);
// Fill the {locale_file} table with an older file.
$file = $this
->mockImportedPoFile($langcode, -1);
// Add language.
$this
->addLanguage($langcode);
// The file was imported, translations should exist.
$strings = array(
'Monday' => 'Montag',
'Tuesday' => 'Dienstag',
);
$this
->checkTranslations($strings, $langcode);
$timestamp = db_query('SELECT timestamp FROM {locale_file} WHERE uri = :uri', array(
':uri' => $file->uri,
))
->fetchField();
// Ensure that $timestamp is now greater than the manipulated timestamp.
$this
->assertTrue($timestamp > $file->timestamp, 'Timestamp on locale_file updated.');
}