3 namespace Drupal\Tests\migrate_plus\Kernel;
5 use Drupal\KernelTests\KernelTestBase;
6 use Drupal\migrate_plus\Entity\Migration;
9 * Test migration config entity discovery.
13 class MigrationConfigEntityTest extends KernelTestBase {
15 public static $modules = ['migrate', 'migrate_plus'];
18 * @var \Drupal\migrate\Plugin\MigrationPluginManager
20 protected $pluginManager;
22 protected function setUp() {
24 $this->pluginManager = \Drupal::service('plugin.manager.migration');
27 public function testCacheInvalidation() {
28 $config = Migration::create([
31 'migration_tags' => [],
34 'migration_dependencies' => [],
38 $this->assertTrue($this->pluginManager->getDefinition('test'));
39 $this->assertSame('Label A', $this->pluginManager->getDefinition('test')['label']);
41 // Clear static cache in the plugin manager, the cache tag take care of the
43 $this->pluginManager->useCaches(FALSE);
44 $this->pluginManager->useCaches(TRUE);
46 $config->set('label', 'Label B');
49 $this->assertSame('Label B', $this->pluginManager->getDefinition('test')['label']);