Clean up testing
This commit is contained in:
parent
61f22d7ffb
commit
1d35e48755
@ -844,13 +844,22 @@ HTML;
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testBaseTagWithForm()
|
/**
|
||||||
|
* @dataProvider getBaseTagWithFormData
|
||||||
|
*/
|
||||||
|
public function testBaseTagWithForm($baseValue, $actionValue, $expectedUri, $currentUri = null, $description = null)
|
||||||
{
|
{
|
||||||
$crawler = new Crawler('<html><base href="/basepath"><form method="post" action="/registration"><button type="submit" name="submit"/></form></html>', 'http://example.com/registration');
|
$crawler = new Crawler('<html><base href="'.$baseValue.'"><form method="post" action="'.$actionValue.'"><button type="submit" name="submit"/></form></html>', $currentUri);
|
||||||
$this->assertEquals('http://example.com/registration', $crawler->filterXPath('//button')->form()->getUri());
|
$this->assertEquals($expectedUri, $crawler->filterXPath('//button')->form()->getUri(), $description);
|
||||||
|
}
|
||||||
|
|
||||||
$crawler = new Crawler('<html><base href="/basepath"><form method="post"><button type="submit" name="submit"/></form></html>', 'http://example.com/registration');
|
public function getBaseTagWithFormData()
|
||||||
$this->assertEquals('http://example.com/registration', $crawler->filterXPath('//button')->form()->getUri());
|
{
|
||||||
|
return array(
|
||||||
|
array('/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and form action'),
|
||||||
|
array('/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and empty form action'),
|
||||||
|
array('http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', '<base> tag does work with a URL and an empty form action'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createTestCrawler($uri = null)
|
public function createTestCrawler($uri = null)
|
||||||
|
Reference in New Issue
Block a user