Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / redirect / tests / src / Kernel / RedirectAPITest.php
index f57e66bc06cfe8110169a7c4864c678af9b10e44..6d982f7c1f5da9bdb49e76de1805a03a26dbc102 100644 (file)
@@ -125,6 +125,19 @@ class RedirectAPITest extends KernelTestBase {
       $this->fail('Failed to find a redirect by source path with query string.');
     }
 
+    // Add a redirect to an external URL.
+    $external_redirect = $this->controller->create();
+    $external_redirect->setSource('google');
+    $external_redirect->setRedirect('https://google.com');
+    $external_redirect->save();
+    $found = $repository->findMatchingRedirect('google');
+    if (!empty($found)) {
+      $this->assertEqual($found->getRedirectUrl()->toString(), 'https://google.com');
+    }
+    else {
+      $this->fail('Failed to find a redirect for google.');
+    }
+
     // Hashes should be case-insensitive since the source paths are.
     /** @var \Drupal\redirect\Entity\Redirect $redirect */
     $redirect = $this->controller->create();