Uh oh!
There was an error while loading. Please reload this page.
Remove Guzzle as dependency - #16
Conversation
SamMousa
commented
May 25, 2025
Parse_url does not support relative urls.
|
Kekos
commented
May 25, 2025
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. |
SamMousa
commented
May 25, 2025
Yes, just get phpstan. For example using phive. |
Kekos
commented
May 26, 2025
I'm not quite sure how a relative URL would apply to the use cases of the |
SamMousa
commented
May 27, 2025
Don't force push please. It makes reviewing harder! |
SamMousa
commented
May 27, 2025
From the webdriver module: privatefunctionfilterNodesByHref(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);
returnarray_filter(
$nodes,
function (WebDriverElement$e) use ($expectedUrl, $absoluteCurrentUrl): bool {
$elementHref = Uri::mergeUrls($absoluteCurrentUrl, $e->getAttribute('href') ?? '');
return$elementHref === $expectedUrl;
}
);
} |
Kekos
commented
Jun 1, 2025
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.