diff --git a/core/modules/link/tests/src/Kernel/LinkItemTest.php b/core/modules/link/tests/src/Kernel/LinkItemTest.php index 5e2c45d..ea81fcb 100644 --- a/core/modules/link/tests/src/Kernel/LinkItemTest.php +++ b/core/modules/link/tests/src/Kernel/LinkItemTest.php @@ -155,6 +155,13 @@ public function testLinkItem() { $this->assertNull($entity->field_test->title); $this->assertIdentical($entity->field_test->options, []); + // Check that if we set the direct value of link field it correctly set the + // uri and the default values of the field. + $entity->field_test = 'tel:112'; + $this->assertEqual($entity->field_test->uri, 'tel:112'); + $this->assertNull($entity->field_test->title); + $this->assertIdentical($entity->field_test->options, []); + // Check that setting options to NULL does not trigger an error when // calling getUrl(); $entity->field_test->options = NULL; diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php index 0c915d4..ef898be 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php @@ -79,6 +79,7 @@ public function testMenuLinks() { $this->assertEntity(469, 'Bing', static::MENU_NAME, 'Bing', TRUE, FALSE, ['attributes' => ['title' => 'Bing']], 'http://bing.com', 0); $this->assertEntity(467, 'Google', static::MENU_NAME, 'Google', TRUE, FALSE, ['attributes' => ['title' => 'Google']], 'http://google.com', 0); $this->assertEntity(468, 'Yahoo', static::MENU_NAME, 'Yahoo', TRUE, FALSE, ['attributes' => ['title' => 'Yahoo']], 'http://yahoo.com', 0); + $this->assertEntity(480, '911', static::MENU_NAME, '911', TRUE, FALSE, ['attributes' => ['title' => '911']], 'tel:911', 0); // Tests migrating an external link with an undefined title attribute. $this->assertEntity(470, 'Ask', static::MENU_NAME, NULL, TRUE, FALSE, [], 'http://ask.com', 0); $this->assertEntity(245, 'Home', 'main', NULL, TRUE, FALSE, [], 'internal:/', 0); diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal7.php b/core/modules/migrate_drupal/tests/fixtures/drupal7.php index 23d8a2e..0d332cd 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal7.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal7.php @@ -19388,6 +19388,33 @@ 'p9' => '0', 'updated' => '0', )) +->values(array( + 'menu_name' => 'menu-test-menu', + 'mlid' => '480', + 'plid' => '0', + 'link_path' => 'tel:911', + 'router_path' => '', + 'link_title' => '911', + 'options' => 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:3:"911";}}', + 'module' => 'menu', + 'hidden' => '0', + 'external' => '1', + 'has_children' => '0', + 'expanded' => '0', + 'weight' => '0', + 'depth' => '0', + 'customized' => '1', + 'p1' => '0', + 'p2' => '0', + 'p3' => '0', + 'p4' => '0', + 'p5' => '0', + 'p6' => '0', + 'p7' => '0', + 'p8' => '0', + 'p9' => '0', + 'updated' => '0', +)) ->execute(); $connection->schema()->createTable('menu_router', array( diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php index ef6dd25..ec75d49 100644 --- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php +++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php @@ -84,6 +84,10 @@ public function providerFromUri() { ['https://www.drupal.org', TRUE], // A protocol-relative URL. ['//www.drupal.org', TRUE], + // A tel URI. + ['tel:911', TRUE], + // A longer tel URI. + ['tel:1234567890', TRUE], // An internal, unrouted, base-relative URI. ['base:robots.txt', FALSE], // Base-relative URIs with special characters.