You are here

public function LingotekFilterConfigUpdate8205Test::testUpgrade in Lingotek Translation 8.2

Tests that the upgrade sets the different filters.

The filters to setup are default filter, account filters, and the different existing profiles.

File

tests/src/Functional/Update/LingotekFilterConfigUpdate8205Test.php, line 30

Class

LingotekFilterConfigUpdate8205Test
Tests the upgrade path for updating the filter defaults.

Namespace

Drupal\Tests\lingotek\Functional\Update

Code

public function testUpgrade() {
  $this
    ->markTestSkipped("New behavior was introduced with update 8212 which supercedes this behavior so no testing is possible");
  $this
    ->runUpdates();
  $profiles = LingotekProfile::loadMultiple();
  foreach ($profiles as $id => $profile) {
    $this
      ->assertIdentical('project_default', $profile
      ->getFilter(), "Profile {$id} default filter is the expected one.");
    $this
      ->assertIdentical('project_default', $profile
      ->getSubFilter(), "Profile {$id} default filter is the expected one.");
  }
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('lingotek.settings');
  $default_filter = $config
    ->get('default.filter');
  $this
    ->assertIdentical('project_default', $default_filter, 'Default filter is the expected one.');
  $filters = $config
    ->get('account.resources.filter');
  $this
    ->assertIdentical([], $filters, 'Account filters is empty.');
}