File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
src/Symfony/Component/DomCrawler Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -839,6 +839,8 @@ private function relativize($xpath)
839
839
$ expression = $ nonMatchingExpression ;
840
840
} elseif (0 === strpos ($ expression , '// ' )) {
841
841
$ expression = 'descendant-or-self:: ' . substr ($ expression , 2 );
842
+ } elseif (0 === strpos ($ expression , '.// ' )) {
843
+ $ expression = 'descendant-or-self:: ' . substr ($ expression , 3 );
842
844
} elseif (0 === strpos ($ expression , './ ' )) {
843
845
$ expression = 'self:: ' . substr ($ expression , 2 );
844
846
} elseif ('/ ' === $ expression [0 ]) {
Original file line number Diff line number Diff line change @@ -376,6 +376,8 @@ public function testFilterXpathComplexQueries()
376
376
$ this ->assertCount (0 , $ crawler ->filterXPath ('/body ' ));
377
377
$ this ->assertCount (1 , $ crawler ->filterXPath ('/_root/body ' ));
378
378
$ this ->assertCount (1 , $ crawler ->filterXPath ('./body ' ));
379
+ $ this ->assertCount (1 , $ crawler ->filterXPath ('.//body ' ));
380
+ $ this ->assertCount (5 , $ crawler ->filterXPath ('.//input ' ));
379
381
$ this ->assertCount (4 , $ crawler ->filterXPath ('//form ' )->filterXPath ('//button | //input ' ));
380
382
$ this ->assertCount (1 , $ crawler ->filterXPath ('body ' ));
381
383
$ this ->assertCount (6 , $ crawler ->filterXPath ('//button | //input ' ));
You can’t perform that action at this time.
0 commit comments