-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
BrowserKit - DomCrawler dependency problem? #18826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also noteworthy, this also wouldn't be caught by your test suite as the |
It seems like the dependency on CssSelector was removed in 3e95126, which is in version 2.1.0 and up. |
It seems like the exact time when the error starts happening is when going from 2.6.1 to 2.6.2:
But I've no idea why, as I can't see any noteworthy code changes to those components by doing |
Looking at your Travis logs, the issue is that the old 2.0.x DomCrawler throws this exception if CssSelector is not found: if (!class_exists('Symfony\\Component\\CssSelector\\CssSelector')) {
// @codeCoverageIgnoreStart
throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector is not installed (you can use filterXPath instead).');
// @codeCoverageIgnoreEnd
} This is thrown in the Although CssSelector is mandatory to run DomCrawler ... its composer.json file in 2.0 says that it is optional: https://github.com/symfony/symfony/blob/2.0/src/Symfony/Component/DomCrawler/composer.json Should we fix the low dependencies of BrowserKit? |
@javiereguiluz given that 2.0 is unmaintained since years, we won't change its composer.json |
@stof it looks like BrowserKit 2.3 allows DomCrawler 2.0: https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/BrowserKit/composer.json |
hmm, the DomCrawler class is indeed broken without CssSelector in 2.0.x (was fixed in 2.1) |
@stof Even in more recent Symfony versions the CssSelector component is only part of the |
@xabbuh sure, but adding content does not rely on |
…ement (jakzal) This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #18980). Discussion ---------- [BrowserKit] Bump the dom-crawler minimum version requirement | Q | A | ------------- | --- | Branch? | 2.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18826 | License | MIT | Doc PR | - The BrowserKit Client will not work with DomCrawler 2.0 if the CssSelector component is not installed. This will require an amendment when merging into the 2.8 branch. It currently uses `~2.0,>=2.0.5|~3.0.0`, while it should be `~2.1|~3.0.0`. Commits ------- 5579d86 [BrowserKit] Bump dom-crawler minimum version requirement
Uh oh!
There was an error while loading. Please reload this page.
I've got a project running on Travis CI which fails when requiring
"browser-kit": "~2.8|~3.0"
and doingcomposer update --prefer-lowest
. A plaincomposer update
works fine.The code being ran is very simple -
$this->client
is an instance ofSymfony\Component\HttpKernel\Client
:The error I'm getting:
I'm not even using CSS filtering, so the error is rather confusing.
I suspect the reason being that
browser-kit
allows very old versions of the DomCrawler component, which maybe aren't compatible:Here's a link to the full Travis CI job: https://travis-ci.org/autarky/skeleton/jobs/131778658#L145
The text was updated successfully, but these errors were encountered: