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'];
20 * @var \Drupal\migrate\Plugin\MigrationPluginManager
22 protected $pluginManager;
27 protected function setUp() {
29 $this->pluginManager = \Drupal::service('plugin.manager.migration');
33 * Tests cache invalidation.
35 public function testCacheInvalidation() {
36 $config = Migration::create([
39 'migration_tags' => [],
42 'migration_dependencies' => [],
46 $this->assertTrue($this->pluginManager->getDefinition('test'));
47 $this->assertSame('Label A', $this->pluginManager->getDefinition('test')['label']);
49 // Clear static cache in the plugin manager, the cache tag take care of the
51 $this->pluginManager->useCaches(FALSE);
52 $this->pluginManager->useCaches(TRUE);
54 $config->set('label', 'Label B');
57 $this->assertSame('Label B', $this->pluginManager->getDefinition('test')['label']);