You are here

public function ConfigUpdaterTest::testIsModified in Commerce Core 8.2

Tests checking whether configuration was modified.

File

tests/src/Kernel/ConfigUpdaterTest.php, line 60

Class

ConfigUpdaterTest
Tests the ConfigUpdater class.

Namespace

Drupal\Tests\commerce\Kernel

Code

public function testIsModified() {
  $config_name = 'commerce_store.commerce_store_type.testing';
  $config = $this->configUpdater
    ->loadFromActive($config_name);
  $this
    ->assertEmpty($this->configUpdater
    ->isModified($config));

  /** @var \Drupal\commerce_store\Entity\StoreTypeInterface $store_type */
  $store_type = \Drupal::entityTypeManager()
    ->getStorage('commerce_store_type')
    ->load('testing');
  $store_type
    ->setDescription('The default store');
  $store_type
    ->save();
  $config = $this->configUpdater
    ->loadFromActive($config_name);
  $this
    ->assertNotEmpty($this->configUpdater
    ->isModified($config));
}