Esempio n. 1
0
 public function testRefresh()
 {
     $entity = new TestEntity('test-id', array('h' => 4, 'w' => 2));
     $this->em->persist($entity);
     $this->em->flush();
     $this->getCb()->set($this->em->getRepository($entity)->getKey($entity->getId()), json_encode(array('id' => $entity->getId(), 'property' => array(4 => 'h', 2 => 'w'))));
     $this->em->refresh($entity);
     $this->assertEquals(array(4 => 'h', 2 => 'w'), $entity->getProperty());
     $this->em->clear();
     $this->getCb()->delete($this->em->getRepository($entity)->getKey($entity->getId()));
 }
Esempio n. 2
0
 /**
  * @expectedException \Ouchbase\Exception\EntityManagerException
  */
 public function testRegisterManagedEntityClassInExceptionalSituation()
 {
     $this->em->getRepository('OuchbaseTest\\TestEntity');
 }