Skip to content

Commit

Permalink
Merge branch '6.2' into 6.3
Browse files Browse the repository at this point in the history
* 6.2:
  [PhpUnitBridge] Kill the last concurrent process when it stales for more than 60s
  [Intl] fix test
  [Intl] Use VarExporter::export() in PhpBundleWriter
  Use triggering class to generate baseline for deprecation messages from DebugClassLoader
  [Security] Fix false-string handling in RememberMeAuthenticator
  [CssSelector] Tests on Xpath translator will always pass
  [Serializer] Fix Normalizer not utilizing converted name for index variadic param
  [DepdencyInjection] Fix costly logic when checking errored definitions
  Fix merge
  fix children cond
  [DoctrineBridge] Load refreshed user proxy
  [DependencyInjection] Don't ignore attributes on the actual decorator
  [FrameworkBundle] Prevent `cache:clear` to lose files on subsequent runs
  • Loading branch information
nicolas-grekas committed Jul 12, 2023
2 parents 88453e6 + 61444c8 commit 883d961
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Tests/XPath/Fixtures/ids.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@
</div>
<div id="foobar-div" foobar="ab bc
cde"><span id="foobar-span"></span></div>
</body></html>
<section>
<span id="no-siblings-of-any-type"></span>
</section>
</body>
</html>
12 changes: 6 additions & 6 deletions Tests/XPath/TranslatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function testHtmlIds($css, array $elementsId)
$document->loadHTMLFile(__DIR__.'/Fixtures/ids.html');
$document = simplexml_import_dom($document);
$elements = $document->xpath($translator->cssToXPath($css));
$this->assertCount(\count($elementsId), $elementsId);
$this->assertCount(\count($elementsId), $elements);
foreach ($elements as $element) {
if (null !== $element->attributes()->id) {
$this->assertContains((string) $element->attributes()->id, $elementsId);
Expand Down Expand Up @@ -304,14 +304,14 @@ public static function getHtmlIdsTestData()
['li:nth-last-child(-n+1)', ['seventh-li']],
['li:nth-last-child(-n+3)', ['fifth-li', 'sixth-li', 'seventh-li']],
['ol:first-of-type', ['first-ol']],
['ol:nth-child(1)', ['first-ol']],
['ol:nth-child(4)', ['first-ol']],
['ol:nth-of-type(2)', ['second-ol']],
['ol:nth-last-of-type(1)', ['second-ol']],
['span:only-child', ['foobar-span']],
['span:only-child', ['foobar-span', 'no-siblings-of-any-type']],
['li div:only-child', ['li-div']],
['div *:only-child', ['li-div', 'foobar-span']],
['p:only-of-type', ['paragraph']],
[':only-of-type', ['html', 'li-div', 'foobar-span', 'paragraph']],
[':only-of-type', ['html', 'li-div', 'foobar-span', 'no-siblings-of-any-type']],
['div#foobar-div :only-of-type', ['foobar-span']],
['a:empty', ['name-anchor']],
['a:EMpty', ['name-anchor']],
Expand All @@ -320,8 +320,8 @@ public static function getHtmlIdsTestData()
['html:root', ['html']],
['li:root', []],
['* :root', []],
['*:contains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']],
[':CONtains("link")', ['html', 'outer-div', 'tag-anchor', 'nofollow-anchor']],
['*:contains("link")', ['html', 'nil', 'outer-div', 'tag-anchor', 'nofollow-anchor']],
[':CONtains("link")', ['html', 'nil', 'outer-div', 'tag-anchor', 'nofollow-anchor']],
['*:contains("LInk")', []], // case sensitive
['*:contains("e")', ['html', 'nil', 'outer-div', 'first-ol', 'first-li', 'paragraph', 'p-em']],
['*:contains("E")', []], // case-sensitive
Expand Down

0 comments on commit 883d961

Please sign in to comment.