Hi Tobias,
i reposted this message since the last one was not relayed - probably
because of the attachment.
I looked into the file "branches/release-1.7/tests/Zend/Amf/ServerTest.php".
First of all the method "testDown" should be renamed in "tearDown".
I have appended a file with some additions to the Amf-ServerTest.
Copy & paste the methods
"Zend_Amf_ServerTest::testDispatchingMethodShouldPassInvocationArgumentsToMethodFromNetConnection"
and "Zend_Amf_testclass::checkStringArgv" to the existing classes.
Without my described fix the special assertion will fail with the message
"All arguments are wrongly wrapped inside an array".
Since this is my first test for ZF please be forgiving...
Best regards,
Dirk
--
class Zend_Amf_ServerTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
unset($this->_server);
}
public function
testDispatchingMethodShouldPassInvocationArgumentsToMethodFromNetConnection()
{
// serialize the data to an AMF output stream
$data[] = "baz";
$this->_server->setClass('Zend_Amf_testclass', '', 'foo', 'bar');
$source = 'Zend_Amf_testclass';
$operation = 'checkStringArgv';
// create a mock message body to place th remoting message inside
$newBody = new Zend_Amf_Value_MessageBody($source.'.'.$operation,
"/1" ,$data);
$request = new Zend_Amf_Request();
// at the requested service to a request
$request->addAmfBody($newBody);
$request->setObjectEncoding(0x03);
// let the server handle mock request
$result = $this->_server->handle($request);
$bodies = $result->getAmfBodies();
$found = false;
foreach ($bodies as $body) {
$data = $body->getData();
if ('baz:foo:bar' == $data) {
$found = true;
break;
}
else if ('Array:foo:bar' == $data) {
$this->assertTrue(false, 'All arguments are wrongly wrapped
inside an array');
}
}
$this->assertTrue($found, 'Valid response not found');
}
}
class Zend_Amf_testclass
{
public function checkStringArgv($message)
{
$argv = func_get_args();
$args = array();
foreach ($argv as $arg) {
$args[] = (string)$arg;
}
return implode(':', $args);
}
}
--
View this message in context:
http://www.nabble.com/Amf-ZF-5094-and-ZF-5388-tp21624321p21665189.html
Sent from the Zend Framework mailing list archive at Nabble.com.