[DomCrawler] added unit tests for previous merge
This commit is contained in:
parent
69468cb9bc
commit
645bd8215e
@ -32,6 +32,10 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
|
||||
|
||||
* added support for loading globally-installed PEAR packages
|
||||
|
||||
### DomCrawler
|
||||
|
||||
* added support for submitting a form without a submit button
|
||||
|
||||
### Finder
|
||||
|
||||
* Finder::exclude() now supports an array of directories as an argument
|
||||
|
@ -399,6 +399,22 @@ class FormTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('http://example.com/id/123#foo', $form->getUri());
|
||||
}
|
||||
|
||||
public function testSubmitWithoutAFormButton()
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
$dom->loadHTML('
|
||||
<html>
|
||||
<form>
|
||||
<input type="foo" />
|
||||
</form>
|
||||
</html>
|
||||
');
|
||||
|
||||
$nodes = $dom->getElementsByTagName('form');
|
||||
$form = new Form($nodes->item(0), 'http://example.com');
|
||||
$this->assertSame($nodes->item(0), $form->getFormNode(), '->getFormNode() returns the form node associated with this form');
|
||||
}
|
||||
|
||||
protected function createForm($form, $method = null, $currentUri = null)
|
||||
{
|
||||
$dom = new \DOMDocument();
|
||||
|
Reference in New Issue
Block a user