From e48d5d07e32c60a086c1e4c0a6096f7365ca36ae Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Fri, 31 May 2019 01:37:35 +0200 Subject: [PATCH] [DomCrawler] Fix type error with null Form::$currentUri --- src/Symfony/Component/DomCrawler/Form.php | 2 +- src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DomCrawler/Form.php b/src/Symfony/Component/DomCrawler/Form.php index 339603d09e..8bdd364347 100644 --- a/src/Symfony/Component/DomCrawler/Form.php +++ b/src/Symfony/Component/DomCrawler/Form.php @@ -44,7 +44,7 @@ class Form extends Link implements \ArrayAccess * * @throws \LogicException if the node is not a button inside a form tag */ - public function __construct(\DOMElement $node, string $currentUri, string $method = null, string $baseHref = null) + public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null) { parent::__construct($node, $currentUri, $method); $this->baseHref = $baseHref; diff --git a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php index c3b40f3226..548fd1833f 100644 --- a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php @@ -1091,6 +1091,7 @@ HTML; ['/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and form action'], ['/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and empty form action'], ['http://base.com/', '/registration', 'http://base.com/registration', 'http://domain.com/registration', ' tag does work with a URL and form action'], + ['http://base.com/', 'http://base.com/registration', 'http://base.com/registration', null, ' tag does work with a URL and form action'], ['http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', ' tag does work with a URL and an empty form action'], ['http://base.com/path', '/registration', 'http://base.com/registration', 'http://domain.com/path/form', ' tag does work with a URL and form action'], ];