'; $writer = new Writer(); $writer->openMemory(); $writer->startElement('body'); $writer->writeAttribute('xmlns', 'http://jabber.org/protocol/httpbind'); $iqRosterPush = new IQRosterPush(); $iqRosterPush->setJid('john@localhost'); $iqRosterPush->setTo('jan@localhost'); $iqRosterPush->setName('john'); $iqRosterPush->setSubscription('both'); $this->assertEquals($iqRosterPush->getJid(), 'john@localhost'); $this->assertEquals($iqRosterPush->getTo(), 'jan@localhost'); $this->assertEquals($iqRosterPush->getName(), 'john'); $this->assertEquals($iqRosterPush->getSubscription(), 'both'); $writer->write($iqRosterPush); // needed to test the xmlSerialize function $writer->endElement(); $result = $writer->outputMemory(); $this->assertEquals($expected, $result); } }