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); } }
public function testGetAttachments() { $item = new Message(); $attachments = ArrayOfAttachment::fromResponse(array(array('id' => 1))); $item->attachments = $attachments; $this->assertEquals($attachments, $item->attachments); }