Conversation
|
Parse_url does not support relative urls.
|
|
Yes, I can see that being a problem. I'll check on it some time. Can I run the static analysis locally? Could only find PHPUnit as a dependency. |
|
Yes, just get phpstan. For example using phive. |
|
I'm not quite sure how a relative URL would apply to the use cases of the |
|
Don't force push please. It makes reviewing harder! |
From the webdriver module: private function filterNodesByHref(string $url, array $nodes): array
{
//current uri can be relative, merging it with configured base url gives absolute url
$absoluteCurrentUrl = Uri::mergeUrls($this->_getUrl(), $this->_getCurrentUri());
$expectedUrl = Uri::mergeUrls($absoluteCurrentUrl, $url);
return array_filter(
$nodes,
function (WebDriverElement $e) use ($expectedUrl, $absoluteCurrentUrl): bool {
$elementHref = Uri::mergeUrls($absoluteCurrentUrl, $e->getAttribute('href') ?? '');
return $elementHref === $expectedUrl;
}
);
} |
|
Thank you! I've checked the use-cases from the webdriver snippet and those seem to be covered by the unit tests. The comment for But I must say, I'm very new to Codeception and it's highly possible I'm missing some very important context. Either way, I'm leaning towards using the PHAR version of Codeception instead. |
The usage of the Guzzle lib inside this library was minimal, only used for URI parsing. Since I don't use Guzzle in my own projects, I thought it could be replaced in this package.