Example #1
0
 /**
  * Test storing attachments.
  *
  * @return NULL
  */
 public function testCacheAttachmentAsContent()
 {
     $data = new Horde_Kolab_Storage_Data('contact');
     $data->setFolder($this->folder);
     $object = array('uid' => '1', 'full-name' => 'User Name', 'email' => '*****@*****.**', 'inline-attachment' => array('test.txt'), '_attachments' => array('test.txt' => array('type' => 'text/plain', 'content' => 'test', 'name' => 'test.txt')));
     $result = $data->save($object);
     $this->assertNoError($result);
     $result = $data->getObject(1);
     $this->assertNoError($result);
     $this->assertTrue(isset($result['_attachments']['test.txt']));
     $this->assertEquals("test\r", $data->getAttachment($result['_attachments']['test.txt']['key']));
 }