Index: ResponseTest.php =================================================================== --- ResponseTest.php (revision 20085) +++ ResponseTest.php (working copy) @@ -87,6 +87,33 @@ } /** + * PHP Large Array Serialization Time + * + */ + public function testLargeArraySerializationTime() + { + // Create php object to serialize + $data = unserialize(gzuncompress(file_get_contents(dirname(__FILE__) .'/Response/mock/largeArrayData.bin'))); + + // Create an acknowlege message for a response to a RemotingMessage + $acknowledgeMessage = new Zend_Amf_Value_Messaging_AcknowledgeMessage(null); + $acknowledgeMessage->body = $data; + + $newBody = new Zend_Amf_Value_MessageBody($this->responseURI, null, $acknowledgeMessage); + + // serialize the data to an AMF output stream + $this->_response->setObjectEncoding(0x03); + $this->_response->addAmfBody($newBody); + $start = microtime(true); + $this->_response->finalize(); + $time = microtime(true) - $start; + + // Check that the response matches the expected serialized value + $this->assertLessThanOrEqual(15, $time); + } + + + /** * PHP String to Amf String * */