diff --git a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
index e019ca95ef..e263b8edde 100644
--- a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
+++ b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
@@ -844,13 +844,22 @@ HTML;
);
}
- public function testBaseTagWithForm()
+ /**
+ * @dataProvider getBaseTagWithFormData
+ */
+ public function testBaseTagWithForm($baseValue, $actionValue, $expectedUri, $currentUri = null, $description = null)
{
- $crawler = new Crawler('
', 'http://example.com/registration');
- $this->assertEquals('http://example.com/registration', $crawler->filterXPath('//button')->form()->getUri());
+ $crawler = new Crawler('', $currentUri);
+ $this->assertEquals($expectedUri, $crawler->filterXPath('//button')->form()->getUri(), $description);
+ }
- $crawler = new Crawler('', 'http://example.com/registration');
- $this->assertEquals('http://example.com/registration', $crawler->filterXPath('//button')->form()->getUri());
+ public function getBaseTagWithFormData()
+ {
+ return array(
+ array('/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and form action'),
+ array('/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', ' tag does work with a path and empty form action'),
+ array('http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', ' tag does work with a URL and an empty form action'),
+ );
}
public function createTestCrawler($uri = null)