Example #1
0
    /**
     * Tests inputXmlConverter->convertMessages()
     */
    public function testConvertMessages()
    {
        $xml = '<?xml version="1.0" encoding="UTF-8"?>
<response xmlns:osapi="http://opensocial.org/2008/opensocialapi">
  <osapi:recipient>example.org:AD38B3886625AAF</osapi:recipient>
  <osapi:recipient>example.org:997638BAA6F25AD</osapi:recipient>
  <title>You have an invitation from Joe</title>
  <id>{msgid}</id>
  <body>Click &lt;a href="http://app.example.org/invites/{msgid}"&gt;here&lt;/a&gt; to review your invitation.</body>
</response>';
        $message = $this->inputXmlConverter->convertMessages($xml);
        $this->assertEquals('{msgid}', $message['id']);
        $this->assertEquals('You have an invitation from Joe', $message['title']);
        $this->assertEquals('Click <a href="http://app.example.org/invites/{msgid}">here</a> to review your invitation.', $message['body']);
        $this->assertEquals('example.org:AD38B3886625AAF', $message['recipients'][0]);
        $this->assertEquals('example.org:997638BAA6F25AD', $message['recipients'][1]);
    }