Skip to content
Snippets Groups Projects
Commit e8de0be7 authored by Joachim Noreiko's avatar Joachim Noreiko
Browse files

Fixed handling of Url $path parameter.

parent 4bfba1d9
No related branches found
No related tags found
2 merge requests!11727Draft: Issue #3517299: Convert functional tests in help module to kernel tests,!9826Resolve #3390193 "Add drupalget with mink to kerneltestbase"
......@@ -9,6 +9,7 @@
use Behat\Mink\Mink;
use Behat\Mink\Selector\SelectorsHandler;
use Behat\Mink\Session;
use Drupal\Core\Url;
use Drupal\Tests\WebAssert;
use Symfony\Component\HttpKernel\HttpKernelBrowser;
......@@ -63,6 +64,14 @@ trait HttpKernelUiHelperTrait {
* @see \Drupal\Tests\BrowserTestBase::getHttpClient()
*/
protected function drupalGet($path, array $options = [], array $headers = []): string {
// Convert a Url object to a string.
if ($path instanceof Url) {
$url_options = $path->getOptions();
$options = $url_options + $options;
$path->setOptions($options);
$path = $path->setAbsolute(FALSE)->toString();
}
$session = $this->getSession();
$session->visit($path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment