public function testWriteTypedObjectVector() { $data = [new ContactElt(["id" => 10, "firstname" => "First name 1", "lastname" => "Last name 1", "email" => "*****@*****.**", "mobile" => "0912345678"]), new ContactElt(["id" => 15, "firstname" => "First name 2", "lastname" => "Last name 2", "email" => "*****@*****.**", "mobile" => "0912345679"]), new ContactElt(["id" => 17, "firstname" => "First name 3", "lastname" => "Last name 3", "email" => "*****@*****.**", "mobile" => "0912345680"])]; $container = new Container(); $container->data = $data; $outputStream = new OutputStream(); $serializer = new Amf3Serializer($outputStream); $serializer->writeTypeMarker($container); // Load the expected binary. $mockFile = file_get_contents(dirname(__FILE__) . '/Parse/mock/amf3TypedVector.bin'); // Check that the serialized binary data matches the expected serialized value $this->assertEquals($mockFile, $outputStream->getStream()); }
/** * Return the output stream content * * @return string The contents of the output stream */ public function getResponse() { return $this->_outputStream->getStream(); }