merged branch jc-/master (PR #2151)

Commits
-------

f4784f7 [DomCrawler] Submit on a <form> node

Discussion
----------

DomCrawler - ability to submit a form that doesn't have any buttons

The proposed modification allows to submit above a &lt;form&gt; tag.
Using the DomCrawler component (among others), I have to interact with a remote site that has a form without a submit button (submitted automatically by javascript). This prompted the quick fix I'm sending. Please tell me if there is anything I should do differently and I'll modify it.
Thanks :)

---------------------------------------------------------------------------

by fabpot at 2011/09/12 00:46:07 -0700

Looks good to me. Can you add some unit tests for this new behavior? Thanks.

---------------------------------------------------------------------------

by jc- at 2011/09/12 02:27:25 -0700

Honored to meet you. I'm trying to run the test suite but 24 tests fail even without my commit. I'll try to get it sorted out and submit tests for this ASAP.
This commit is contained in:
Fabien Potencier 2011-09-23 08:05:44 +02:00
commit 69468cb9bc

View File

@ -381,7 +381,7 @@ class Form extends Link implements \ArrayAccess
throw new \LogicException('The selected node does not have a form ancestor.');
}
} while ('form' != $node->nodeName);
} else {
} elseif('form' != $node->nodeName) {
throw new \LogicException(sprintf('Unable to submit on a "%s" tag.', $node->nodeName));
}