Skip to content
Snippets Groups Projects
Commit 3e3a2074 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2562075 by phenaproxima: D7 menu link migration must provide a default description

parent d1119049
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -18,6 +18,7 @@ process: ...@@ -18,6 +18,7 @@ process:
- 0 - 0
- attributes - attributes
- title - title
default: ''
menu_name: menu_name:
plugin: migration plugin: migration
migration: menu migration: menu
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\menu_link_content\Tests\Migrate\d7; namespace Drupal\menu_link_content\Tests\Migrate\d7;
use Drupal\Core\Database\Database;
use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\menu_link_content\Entity\MenuLinkContent;
use Drupal\menu_link_content\MenuLinkContentInterface; use Drupal\menu_link_content\MenuLinkContentInterface;
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase; use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
...@@ -33,7 +34,6 @@ protected function setUp() { ...@@ -33,7 +34,6 @@ protected function setUp() {
$this->installSchema('system', ['router']); $this->installSchema('system', ['router']);
$this->installEntitySchema('menu_link_content'); $this->installEntitySchema('menu_link_content');
$this->executeMigration('menu'); $this->executeMigration('menu');
$this->executeMigration('d7_menu_links');
} }
/** /**
...@@ -78,9 +78,26 @@ protected function assertEntity($id, $title, $menu, $description, $enabled, $exp ...@@ -78,9 +78,26 @@ protected function assertEntity($id, $title, $menu, $description, $enabled, $exp
* Tests migration of menu links. * Tests migration of menu links.
*/ */
public function testMenuLinks() { public function testMenuLinks() {
$this->executeMigration('d7_menu_links');
$this->assertEntity(467, 'Google', 'menu-test-menu', 'Google', TRUE, FALSE, ['attributes' => ['title' => 'Google']], 'http://google.com', 0); $this->assertEntity(467, 'Google', 'menu-test-menu', 'Google', TRUE, FALSE, ['attributes' => ['title' => 'Google']], 'http://google.com', 0);
$this->assertEntity(468, 'Yahoo', 'menu-test-menu', 'Yahoo', TRUE, FALSE, ['attributes' => ['title' => 'Yahoo']], 'http://yahoo.com', 0); $this->assertEntity(468, 'Yahoo', 'menu-test-menu', 'Yahoo', TRUE, FALSE, ['attributes' => ['title' => 'Yahoo']], 'http://yahoo.com', 0);
$this->assertEntity(469, 'Bing', 'menu-test-menu', 'Bing', TRUE, FALSE, ['attributes' => ['title' => 'Bing']], 'http://bing.com', 0); $this->assertEntity(469, 'Bing', 'menu-test-menu', 'Bing', TRUE, FALSE, ['attributes' => ['title' => 'Bing']], 'http://bing.com', 0);
} }
/**
* Tests migrating a link with an undefined title attribute.
*/
public function testUndefinedLinkTitle() {
Database::getConnection('default', 'migrate')
->update('menu_links')
->fields(array(
'options' => 'a:0:{}',
))
->condition('mlid', 467)
->execute();
$this->executeMigration('d7_menu_links');
$this->assertEntity(467, 'Google', 'menu-test-menu', NULL, TRUE, FALSE, [], 'http://google.com', 0);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment