Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / node / tests / src / Kernel / Migrate / d6 / MigrateNodeDeriverTest.php
1 <?php
2
3 namespace Drupal\Tests\node\Kernel\Migrate\d6;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
6
7 /**
8  * Test D6NodeDeriver.
9  *
10  * @group migrate_drupal_6
11  */
12 class MigrateNodeDeriverTest extends MigrateDrupal6TestBase {
13   /**
14    * The migration plugin manager.
15    *
16    * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface
17    */
18   protected $pluginManager;
19
20   /**
21    * {@inheritdoc}
22    */
23   public function setUp() {
24     parent::setUp();
25     $this->pluginManager = $this->container->get('plugin.manager.migration');
26   }
27
28   /**
29    * Test node translation migrations with translation disabled.
30    */
31   public function testNoTranslations() {
32     // Without content_translation, there should be no translation migrations.
33     $migrations = $this->pluginManager->createInstances('d6_node_translation');
34     $this->assertSame([], $migrations,
35       "No node translation migrations without content_translation");
36   }
37
38   /**
39    * Test node translation migrations with translation enabled.
40    */
41   public function testTranslations() {
42     // With content_translation, there should be translation migrations for
43     // each content type.
44     $this->enableModules(['language', 'content_translation']);
45     $migrations = $this->pluginManager->createInstances('d6_node_translation');
46     $this->assertArrayHasKey('d6_node_translation:story', $migrations,
47       "Node translation migrations exist after content_translation installed");
48   }
49
50 }