public function LanguageUpgradePathTest::testLanguageNoPluralsUpgrade

Tests upgrading translations without plurals.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php, line 179
Definition of Drupal\system\Tests\Upgrade\LanguageUpgradePathTest.

Class

LanguageUpgradePathTest
Tests upgrading a filled database with language data.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testLanguageNoPluralsUpgrade() {

  // Remove all plural translations from the database.
  db_delete('locales_target')
    ->condition('plural', 0, '<>')
    ->execute();
  $this
    ->assertTrue($this
    ->performUpgrade(), 'The upgrade was completed successfully.');

  // Check if locale_update_8005() is succesfully completed by checking
  // whether index 'plural' has been removed.
  $this
    ->assertFalse(db_index_exists('locales_target', 'plural'), 'Translations without plurals upgraded.');
}