UrlParameterTest.php in Login Destination 8
File
tests/src/Functional/UrlParameterTest.php
View source
<?php
namespace Drupal\Tests\login_destination\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Core\Url;
class UrlParameterTest extends BrowserTestBase {
public static $modules = [
'login_destination',
];
public function testNoParameterOnUnroutedLink() {
$element = [
'#title' => $this
->randomString(),
'#type' => 'link',
'#url' => Url::fromUserInput('/' . $this
->randomMachineName()),
];
$rendered_link = $this->container
->get('renderer')
->renderPlain($element)
->__toString();
$this
->assertNotContains('?current=', $rendered_link);
}
}