Esempio n. 1
0
 /**
  * Test the getObjectFromArgs method.
  */
 public function testGetObjectFromArgs()
 {
     $entity = new DummyEntity();
     $args = $this->getMockBuilder('Doctrine\\ORM\\Event\\LifecycleEventArgs')->disableOriginalConstructor()->getMock();
     $args->expects($this->once())->method('getEntity')->will($this->returnValue($entity));
     $adapter = new DoctrineORMAdapter();
     $this->assertEquals($entity, $adapter->getObjectFromArgs($args));
 }
 /**
  * Tests the getReflectionClass method with a proxy.
  */
 public function testGetReflectionClassProxy()
 {
     if (!interface_exists('Doctrine\\ORM\\Proxy\\Proxy')) {
         $this->markTestSkipped('Doctrine\\ORM\\Proxy\\Proxy does not exist.');
     } else {
         $obj = new DummyEntityProxyORM();
         $adapter = new DoctrineORMAdapter();
         $class = $adapter->getReflectionClass($obj);
         $this->assertEquals($class->getName(), get_parent_class($obj));
     }
 }