/** * Check that when using server->setSession you get an amf header that has an append to gateway sessionID * @group ZF-5381 */ public function testSessionAmf3() { \fproject\amf\session\Session::$_unitTestEnabled = true; \fproject\amf\session\Session::start(); $this->_server->setClass('Zend_Amf_testSession'); $this->_server->setSession(); // create a mock remoting message $message = new RemotingMessage(); $message->operation = 'getCount'; $message->source = 'Zend_Amf_testSession'; $message->body = array(); // create a mock message body to place th remoting message inside $newBody = new MessageBody(null, "/1", $message); $request = new Request(); // at the requested service to a request $request->addAmfBody($newBody); $request->setObjectEncoding(0x3); // let the server handle mock request $result = $this->_server->handle($request); $response = $this->_server->getResponse(); $responseBody = $response->getAmfBodies(); // Now check if the return data was properly set. $acknowledgeMessage = $responseBody[0]->getData(); // check that we have a message beening returned $this->assertEquals(1, $acknowledgeMessage->body); // check that a header is being returned for the session id $headerBody = $response->getAmfHeaders(); $this->assertEquals('AppendToGatewayUrl', $headerBody[0]->name); // Do not stop session since it still can be used by other tests // \fproject\amf\session\Session::stop(); }