Skip to content

Commit 067e301

Browse files
committed
The BrowserKit history with parameter separator without slash.
1 parent 3537d17 commit 067e301

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

AbstractBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ protected function getAbsoluteUri(string $uri): string
656656
$uri = $path.$uri;
657657
}
658658

659-
return preg_replace('#^(.*?//[^/]+)\/.*$#', '$1', $currentUri).$uri;
659+
return preg_replace('#^(.*?//[^/?]+)[/?].*$#', '$1', $currentUri).$uri;
660660
}
661661

662662
/**

Tests/AbstractBrowserTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,4 +889,13 @@ public function testInternalRequestNull()
889889

890890
$client->getInternalRequest();
891891
}
892+
893+
public function testHistoryWithParametersAndNoSlash()
894+
{
895+
$client = $this->getBrowser();
896+
$client->request('GET', 'https://www.example.com?the=value');
897+
$client->request('GET', '/path/?parameter=value');
898+
899+
$this->assertSame('https://www.example.com/path/?parameter=value', $client->getRequest()->getUri(), '->request() history provides proper base.');
900+
}
892901
}

0 commit comments

Comments
 (0)