>
> you can set it within the test method with:
> $this->request->setMethod('POST')->setRawBody('<xml/>');
>
Hi, this doesn't appear to be working. In my controller, it appears as if
the raw POST data is not there (or empty). The fact that it is empty means
that the raw POST data isn't getting sent. Here is my full test code:
public function testSendRawXML()
{
$xml = '<someXml>12345</someXml>';
$this->request->setMethod('POST')->setRawBody($xml);
$this->dispatch('/controller/action');
}
In my controller, I am reading in the raw POST data with the following code:
$xml = file_get_contents('php://input');
It is evaluating to empty, so it doesn't look like raw POST is getting set.
Any ideas?
--
View this message in context: http://www.nabble.com/Zend_Test---How-to-emulate-raw-XML-POST-data--tp20784041p20802478.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论