Skip to content

Commit

Permalink
Merge branch 'DDC-1610'
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jan 21, 2012
2 parents 44831f2 + faf9288 commit 1d46d2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ protected function loadMetadata($name)
// Invoke driver
try {
$this->driver->loadMetadataForClass($className, $class);
$this->wakeupReflection($class, $this->getReflectionService());
} catch (ReflectionException $e) {
throw MappingException::reflectionFailure($className, $e);
}
Expand Down Expand Up @@ -333,6 +332,7 @@ protected function loadMetadata($name)
$eventArgs = new \Doctrine\ORM\Event\LoadClassMetadataEventArgs($class, $this->em);
$this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
}
$this->wakeupReflection($class, $this->getReflectionService());

$this->validateRuntimeMetadata($class, $parent);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

class ClassMetadataLoadEventTest extends \Doctrine\Tests\OrmTestCase
{
/**
* @group DDC-1610
*/
public function testEvent()
{
$em = $this->_getTestEntityManager();
Expand All @@ -17,6 +20,8 @@ public function testEvent()
$evm->addEventListener(Events::loadClassMetadata, $this);
$classMetadata = $metadataFactory->getMetadataFor('Doctrine\Tests\ORM\Mapping\LoadEventTestEntity');
$this->assertTrue($classMetadata->hasField('about'));
$this->assertArrayHasKey('about', $classMetadata->reflFields);
$this->assertInstanceOf('ReflectionProperty', $classMetadata->reflFields['about']);
}

public function loadClassMetadata(\Doctrine\ORM\Event\LoadClassMetadataEventArgs $eventArgs)
Expand Down Expand Up @@ -48,4 +53,4 @@ class LoadEventTestEntity
private $name;

private $about;
}
}

0 comments on commit 1d46d2b

Please sign in to comment.