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

Skip to content

[CssSelector] Tests on Xpath translator will always pass #50729

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

Merged

Conversation

franckranaivo
Copy link
Contributor

While working on another PR (#49388), I noticed that the assertion below will always pass as it is testing the count of the same array on both side.

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

Instead of
$this->assertCount(\count($elementsId), $elementsId);
It should be
$this->assertCount(\count($elementsId), $elements);

This PR should fix also numbers and/or Xpath translator issues from this fixed assertion.

P.S.
This is the right PR for this issue (#50726)

@nicolas-grekas
Copy link
Member

And the test now fails 😅
Can you have a look?

@franckranaivo
Copy link
Contributor Author

And the test now fails 😅 Can you have a look?

Sure, this is why @stof suggested me here to fix also failing tests from this PR.

@franckranaivo
Copy link
Contributor Author

Fixed the failing tests. Xpath translator in itself is not to blame, it is just some wrong assertion or misunderstanding of rules of the selector for some tests.

@nicolas-grekas nicolas-grekas force-pushed the fix-test-xpath-translator branch from 5e2d5d1 to bb123ab Compare July 7, 2023 06:10
@nicolas-grekas
Copy link
Member

Good catch, thanks @franckranaivo.

@nicolas-grekas nicolas-grekas merged commit 11fa1be into symfony:5.4 Jul 7, 2023
@franckranaivo franckranaivo deleted the fix-test-xpath-translator branch July 10, 2023 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants