Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[2.3][CssSelector] Added test to highlight a regression #8286

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

Closed
wants to merge 1 commit into from

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Jun 16, 2013

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no (that's the point)
Fixed tickets -
License MIT
Doc PR -

Hello.

I tried to use latest Symfony2 version in fapot/sismo, and sismo tests fail because of a regression in CssSelector Component.

You can easily reproduce it by cloning sismo, run a composer update, then phpunit.

I tried to debug it, but DomDocument and XPath don't like me.

ping @jfsimon

@jfsimon
Copy link
Contributor

jfsimon commented Jun 16, 2013

@lyrixx This is not a bug, but a feature! There are now 2 modes fox CssSelector: HTML & XML.
To use CssSelector with XML you need to disable HTML extension (which is enabled by default).

CssSelector::disableHtmlExtension();

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php#L38

@lyrixx
Copy link
Member Author

lyrixx commented Jun 16, 2013

Ok, thanks. So now, This is not easy to test both xml and html.

In functional test, since the crawler is instanciated by the de browser kit (which know the content-type), Can we imagine the browser kit call for us disableHtmlExtension or enableHtmlExtension

fabpot added a commit that referenced this pull request Jun 17, 2013
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #8287).

Discussion
----------

[CssSelector] added a node about HTML extension in readme

It's a common mistake to use `CssSelector` with XML without knowing that `HTML` extension must be disbaled first (see #8286). This PR adds a note about that in the component's readme file.

Commits
-------

4235b26 [CssSelector] added a node about HTML extension in readme
@fabpot
Copy link
Member

fabpot commented Jul 2, 2013

Closing in favor of #8404

@fabpot fabpot closed this Jul 2, 2013
@lyrixx lyrixx deleted the css-selector-regression branch July 2, 2013 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants