Loading tests/src/Functional/RedirectTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class RedirectTest extends TestBase { $this->drupalLogin($this->adminUser); $message = $this->randomMachineName(); // Not redirect authenticated user. $this->setRedirectConfig($this->authenticatedUser->toUrl()->toString()); $this->setRedirectConfig($this->authenticatedUser->toUrl('canonical', ['base_url' => ''])->toString()); $this->logoutNotRedirectHelper($this->authenticatedUser, $this->authenticatedUser->toUrl()->toString(), $message); // Redirect testing with regular user. // Frontpage. Loading @@ -46,10 +46,10 @@ class RedirectTest extends TestBase { $this->logoutRedirectHelper($this->regularUser, '/foobar-example', $message); // Path only token. $this->setRedirectConfig('[current-user:url]', $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl()->toString(), $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl('canonical', ['base_url' => ''])->toString(), $message); // Token with left slash: /[current-user:url] transform to [current-user:url] destination. $this->setRedirectConfig('/[current-user:url]', $message, NULL, '[current-user:url]'); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl()->toString(), $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl('canonical', ['base_url' => ''])->toString(), $message); } } tests/src/Functional/TestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ abstract class TestBase extends BrowserTestBase { 'type' => 'page', 'title' => 'Example node title', ]); $this->createPathAlias($this->testNode->toUrl()->toString(), '/foobar-example'); $this->createPathAlias($this->testNode->toUrl('canonical', ['base_url' => ''])->toString(), '/foobar-example'); // Create test configuration for tokens. $config = $this->config('system.site'); $config->set('name', 'example'); Loading Loading
tests/src/Functional/RedirectTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class RedirectTest extends TestBase { $this->drupalLogin($this->adminUser); $message = $this->randomMachineName(); // Not redirect authenticated user. $this->setRedirectConfig($this->authenticatedUser->toUrl()->toString()); $this->setRedirectConfig($this->authenticatedUser->toUrl('canonical', ['base_url' => ''])->toString()); $this->logoutNotRedirectHelper($this->authenticatedUser, $this->authenticatedUser->toUrl()->toString(), $message); // Redirect testing with regular user. // Frontpage. Loading @@ -46,10 +46,10 @@ class RedirectTest extends TestBase { $this->logoutRedirectHelper($this->regularUser, '/foobar-example', $message); // Path only token. $this->setRedirectConfig('[current-user:url]', $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl()->toString(), $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl('canonical', ['base_url' => ''])->toString(), $message); // Token with left slash: /[current-user:url] transform to [current-user:url] destination. $this->setRedirectConfig('/[current-user:url]', $message, NULL, '[current-user:url]'); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl()->toString(), $message); $this->logoutRedirectHelper($this->regularUser, $this->regularUser->toUrl('canonical', ['base_url' => ''])->toString(), $message); } }
tests/src/Functional/TestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ abstract class TestBase extends BrowserTestBase { 'type' => 'page', 'title' => 'Example node title', ]); $this->createPathAlias($this->testNode->toUrl()->toString(), '/foobar-example'); $this->createPathAlias($this->testNode->toUrl('canonical', ['base_url' => ''])->toString(), '/foobar-example'); // Create test configuration for tokens. $config = $this->config('system.site'); $config->set('name', 'example'); Loading