Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / path / tests / src / Kernel / Migrate / d7 / MigrateUrlAliasTest.php
index 2edf258eea804b8ae39b4bfa9608a8861b73530f..dae024950010a5627f123a2094911555f2eed971 100644 (file)
@@ -48,7 +48,9 @@ class MigrateUrlAliasTest extends MigrateDrupal7TestBase {
    * Test the URL alias migration.
    */
   public function testUrlAlias() {
-    $path = \Drupal::service('path.alias_storage')->load([
+    $alias_storage = $this->container->get('path.alias_storage');
+
+    $path = $alias_storage->load([
       'source' => '/taxonomy/term/4',
       'alias' => '/term33',
       'langcode' => 'und',
@@ -56,6 +58,11 @@ class MigrateUrlAliasTest extends MigrateDrupal7TestBase {
     $this->assertIdentical('/taxonomy/term/4', $path['source']);
     $this->assertIdentical('/term33', $path['alias']);
     $this->assertIdentical('und', $path['langcode']);
+
+    // Alias with no slash.
+    $path = $alias_storage->load(['alias' => '/source-noslash']);
+    $this->assertSame('/admin', $path['source']);
+    $this->assertSame('und', $path['langcode']);
   }
 
   /**