[DomCrawler] added unit tests for previous merge

This commit is contained in:
Fabien Potencier 2011-09-23 08:10:01 +02:00
parent 69468cb9bc
commit 645bd8215e
2 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -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();