diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php index f1368ed43b..58f4b89793 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php @@ -36,7 +36,13 @@ public function testMenuLinks() { $this->assertIdentical('Test menu link 1', $menu_link->getDescription()); $this->assertIdentical(TRUE, $menu_link->isEnabled()); $this->assertIdentical(FALSE, $menu_link->isExpanded()); - $this->assertIdentical(['attributes' => ['title' => 'Test menu link 1']], $menu_link->link->options); + $attributes= [ + 'attributes' => [ + 'title' => 'Test menu link 1', + ], + 'langcode' => 'en', + ]; + $this->assertSame($attributes, $menu_link->link->options); $this->assertIdentical('internal:/user/login', $menu_link->link->uri); $this->assertIdentical(-50, $menu_link->getWeight()); @@ -70,6 +76,23 @@ public function testMenuLinks() { $this->assertIdentical([], $menu_link->link->options); $this->assertIdentical('internal:/user/login', $menu_link->link->uri); $this->assertIdentical(-47, $menu_link->getWeight()); + + $menu_link = MenuLinkContent::load(459); + $this->assertSame('fr - Test 1', $menu_link->getTitle()); + $this->assertSame('secondary-links', $menu_link->getMenuName()); + $this->assertSame('fr - Test menu link 1', $menu_link->getDescription()); + $this->assertSame(TRUE, $menu_link->isEnabled()); + $this->assertSame(FALSE, $menu_link->isExpanded()); + $attributes= [ + 'attributes' => [ + 'title' => 'fr - Test menu link 1', + ], + 'langcode' => 'fr', + 'alter' => TRUE + ]; + $this->assertSame($attributes, $menu_link->link->options); + $this->assertSame('internal:/user/login', $menu_link->link->uri); + $this->assertSame(-49, $menu_link->getWeight()); } } diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php index 065893d4c6..62d01dd7cf 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php @@ -67,6 +67,23 @@ public function testMenuLinks() { $this->assertSame(['attributes' => ['title' => '']], $menu_link->link->options); $this->assertSame('https://www.drupal.org', $menu_link->link->uri); $this->assertSame(-50, $menu_link->getWeight()); + + $menu_link = MenuLinkContent::load(459); + $this->assertSame('fr - Test 1', $menu_link->getTitle()); + $this->assertSame('fr - Test menu link 1', $menu_link->getDescription()); + $this->assertSame('secondary-links', $menu_link->getMenuName()); + $this->assertSame(TRUE, $menu_link->isEnabled()); + $this->assertSame(FALSE, $menu_link->isExpanded()); + $attributes= [ + 'attributes' => [ + 'title' => 'fr - Test menu link 1', + ], + 'langcode' => 'fr', + 'alter' => TRUE, + ]; + $this->assertSame($attributes, $menu_link->link->options); + $this->assertSame('internal:/user/login', $menu_link->link->uri); + $this->assertSame(-49, $menu_link->getWeight()); } } diff --git a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php index c7c0334a39..c01e4f6015 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Plugin/migrate/source/d6/MenuLinkTranslationTest.php @@ -49,7 +49,6 @@ public function providerSource() { 'p8' => '0', 'p9' => '0', 'updated' => '0', - 'description' => 'Test menu link 1', ], [ 'menu_name' => 'menu-test-menu', @@ -77,7 +76,6 @@ public function providerSource() { 'p8' => '0', 'p9' => '0', 'updated' => '0', - 'description' => 'Test menu link 2', ], [ 'menu_name' => 'menu-test-menu', @@ -105,7 +103,6 @@ public function providerSource() { 'p8' => '0', 'p9' => '0', 'updated' => '0', - 'description' => 'Test menu link 2', ], [ 'menu_name' => 'menu-test-menu', @@ -133,7 +130,6 @@ public function providerSource() { 'p8' => '0', 'p9' => '0', 'updated' => '0', - 'description' => 'Test menu link 3', ], ]; $test[0]['source_data']['i18n_strings'] = [ @@ -230,7 +226,6 @@ public function providerSource() { [ 'menu_name' => 'menu-test-menu', 'mlid' => 140, - 'description' => 'Test menu link 2', 'property' => 'description', 'language' => 'zu', 'title_untranslated' => 'Test 2', diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 0a62057234..242b8ce29f 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -9640,6 +9640,38 @@ 'objectindex' => '7', 'format' => '0', )) +->values(array( + 'lid' => '1674', + 'objectid' => '459', + 'type' => 'item', + 'property' => 'title', + 'objectindex' => '459', + 'format' => '0', +)) +->values(array( + 'lid' => '1675', + 'objectid' => '459', + 'type' => 'item', + 'property' => 'description', + 'objectindex' => '459', + 'format' => '0', +)) +->values(array( + 'lid' => '1676', + 'objectid' => '138', + 'type' => 'item', + 'property' => 'title', + 'objectindex' => '138', + 'format' => '0', +)) +->values(array( + 'lid' => '1677', + 'objectid' => '138', + 'type' => 'item', + 'property' => 'description', + 'objectindex' => '138', + 'format' => '0', +)) ->execute(); $connection->schema()->createTable('i18n_variable', array( @@ -22106,6 +22138,34 @@ 'source' => 'Forums', 'version' => '1', )) +->values(array( + 'lid' => '1674', + 'location' => 'item:459:title', + 'textgroup' => 'menu', + 'source' => 'fr - Test 1', + 'version' => '1', +)) +->values(array( + 'lid' => '1675', + 'location' => 'item:459:description', + 'textgroup' => 'menu', + 'source' => 'fr - Test menu link 1', + 'version' => '1', +)) +->values(array( + 'lid' => '1676', + 'location' => 'item:138:title', + 'textgroup' => 'menu', + 'source' => 'Test 1', + 'version' => '1', +)) +->values(array( + 'lid' => '1677', + 'location' => 'item:138:description', + 'textgroup' => 'menu', + 'source' => 'Test menu link 1', + 'version' => '1', +)) ->execute(); $connection->schema()->createTable('locales_target', array( @@ -27635,7 +27695,7 @@ 'link_path' => 'user/login', 'router_path' => 'user/login', 'link_title' => 'Test 1', - 'options' => 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:16:"Test menu link 1";}}', + 'options' => 'a:2:{s:10:"attributes";a:1:{s:5:"title";s:16:"Test menu link 1";}s:8:"langcode";s:2:"en";}', 'module' => 'menu', 'hidden' => '0', 'external' => '0', @@ -33649,6 +33709,33 @@ 'p9' => '0', 'updated' => '0', )) +->values(array( + 'menu_name' => 'secondary-links', + 'mlid' => '459', + 'plid' => '139', + 'link_path' => 'user/login', + 'router_path' => 'user/login', + 'link_title' => 'fr - Test 1', + 'options' => 'a:3:{s:10:"attributes";a:1:{s:5:"title";s:21:"fr - Test menu link 1";}s:8:"langcode";s:2:"fr";s:5:"alter";b:1;}', + 'module' => 'menu', + 'hidden' => '0', + 'external' => '0', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '-49', + 'depth' => '2', + 'customized' => '1', + 'p1' => '139', + 'p2' => '459', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', +)) ->execute(); $connection->schema()->createTable('menu_router', array(