Chris@0: pluginMananger = \Drupal::service('plugin.manager.config_entity_migration'); Chris@0: } Chris@0: Chris@0: public function testCacheInvalidation() { Chris@0: $config = Migration::create([ Chris@0: 'id' => 'test', Chris@0: 'label' => 'Label A', Chris@0: 'migration_tags' => [], Chris@0: 'source' => [], Chris@0: 'destination' => [], Chris@0: 'migration_dependencies' => [], Chris@0: ]); Chris@0: $config->save(); Chris@0: Chris@0: $this->assertTrue($this->pluginMananger->getDefinition('test')); Chris@0: $this->assertSame('Label A', $this->pluginMananger->getDefinition('test')['label']); Chris@0: Chris@0: // Clear static cache in the plugin manager, the cache tag take care of the Chris@0: // persistent cache. Chris@0: $this->pluginMananger->useCaches(FALSE); Chris@0: $this->pluginMananger->useCaches(TRUE); Chris@0: Chris@0: $config->set('label', 'Label B'); Chris@0: $config->save(); Chris@0: Chris@0: $this->assertSame('Label B', $this->pluginMananger->getDefinition('test')['label']); Chris@0: $this->assertSame('Label B', \Drupal::service('plugin.manager.migration')->getDefinition('test')['label']); Chris@0: } Chris@0: Chris@0: }