예제 #1
0
파일: Scenario.php 프로젝트: horde/horde
 /**
  * Assert that a save() operation yields some predictable attribute results.
  *
  * @param Horde_Kolab_Server_Object  $object The object to work on.
  * @param Horde_Kolab_Server         $server The server the object resides on.
  * @param array                      $store  The information to save.
  * @param array                      $fetch  The expected results.
  *
  * @return NULL.
  */
 protected function assertStoreFetch(Horde_Kolab_Server_Object $object, Horde_Kolab_Server $server, array $store, array $fetch, $pop_arrays = false)
 {
     $result = $object->save($store);
     $this->assertNoError($result);
     $object = $server->fetch($object->getUid());
     foreach ($fetch as $attribute => $expect) {
         $actual = $object->get($attribute, false);
         if ($pop_arrays && is_array($actual) && count($actual) == 1) {
             $actual = array_pop($actual);
         }
         $this->assertEquals($expect, $actual);
     }
 }