public function LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 4.0.x tests/src/Functional/Update/LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php \Drupal\Tests\lingotek\Functional\Update\LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade()
- 3.4.x tests/src/Functional/Update/LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php \Drupal\Tests\lingotek\Functional\Update\LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade()
- 3.5.x tests/src/Functional/Update/LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php \Drupal\Tests\lingotek\Functional\Update\LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade()
- 3.6.x tests/src/Functional/Update/LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php \Drupal\Tests\lingotek\Functional\Update\LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade()
- 3.7.x tests/src/Functional/Update/LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php \Drupal\Tests\lingotek\Functional\Update\LingotekUpgrade9401AddUploadedAndUpdatedFieldTest::testUpgrade()
Tests the upgrade for adding 'updated date' and 'last uploaded' fields.
File
- tests/
src/ Functional/ Update/ LingotekUpgrade9401AddUploadedAndUpdatedFieldTest.php, line 28
Class
- LingotekUpgrade9401AddUploadedAndUpdatedFieldTest
- Tests the upgrade path for adding 'updated date' and 'last uploaded' fields.
Namespace
Drupal\Tests\lingotek\Functional\UpdateCode
public function testUpgrade() {
try {
\Drupal::database()
->select('lingotek_metadata', 'lmd')
->fields('lmd', [
'updated_timestamp',
'uploaded_timestamp',
])
->execute()
->fetch();
$this
->fail('Update 9401 seems to have run prior to updates');
} catch (DatabaseExceptionWrapper $exception) {
// Do nothing
}
$this
->runUpdates();
try {
\Drupal::database()
->select('lingotek_metadata', 'lmd')
->fields('lmd', [
'updated_timestamp',
'uploaded_timestamp',
])
->execute()
->fetch();
} catch (DatabaseExceptionWrapper $exception) {
$this
->fail('Update 9401 didn\'t add the expected fields: ' . $exception
->getMessage());
}
}