public function ShortcutUpgradePathTest::testContactUpgrade

Tests upgrade of {shortcut_set} table to configuration entities.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/ShortcutUpgradePathTest.php, line 36
Contains \Drupal\system\Tests\Upgrade\ShortcutUpgradePathTest.

Class

ShortcutUpgradePathTest
Tests upgrade of shortcut.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testContactUpgrade() {
  $this
    ->assertTrue(db_table_exists('shortcut_set'), 'Table {shortcut_set} exists.');
  $this
    ->assertTrue($this
    ->performUpgrade(), 'The upgrade was completed successfully.');
  $this
    ->assertFalse(db_table_exists('shortcut_set'), 'Table {shortcut_set} has been deleted.');

  // Ensure that the Drupal 7 default set has been created.
  $set = entity_load('shortcut', 'default');
  $this
    ->assertTrue($set
    ->uuid(), 'Converted set has a UUID');
  $this
    ->assertEqual($set
    ->label(), 'Default');

  // Test that the custom set has been updated.
  $set = entity_load('shortcut', 'shortcut-set-2');
  $this
    ->assertTrue($set
    ->uuid(), 'Converted set has a UUID');
  $this
    ->assertEqual($set
    ->label(), 'Custom shortcut set');
}