$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();