Ejemplo n.º 1
0
 public function testFromResponse()
 {
     $actual = ArrayOfAttachment::fromResponse(array(array('id' => 1, 'type' => 'jpeg', 'size' => 600, 'filename' => 'testfile', 'mime_type' => 'image/jpeg', 'url' => 'http://google.ru')));
     $expected = array(Attachment::fromResponse(array('id' => 1, 'type' => 'jpeg', 'size' => 600, 'filename' => 'testfile', 'mime_type' => 'image/jpeg', 'url' => 'http://google.ru')));
     foreach ($actual as $key => $item) {
         $this->assertEquals($expected[$key], $item);
     }
 }
Ejemplo n.º 2
0
 public function testGetAttachments()
 {
     $item = new Message();
     $attachments = ArrayOfAttachment::fromResponse(array(array('id' => 1)));
     $item->attachments = $attachments;
     $this->assertEquals($attachments, $item->attachments);
 }