1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

split override test

This commit is contained in:
Fabio B. Silva 2012-11-09 15:47:57 -02:00 committed by fabio.silva
parent 0d0fc320b4
commit 7b0f59ed7c
4 changed files with 12 additions and 6 deletions

View file

@ -72,7 +72,7 @@ class ListenersInvoker
$method = $listener['method']; $method = $listener['method'];
$instance = $this->resolver->resolve($class); $instance = $this->resolver->resolve($class);
$instance->{$method}($entity, $event); $instance->$method($entity, $event);
} }
} }
} }

View file

@ -4,8 +4,6 @@ namespace Doctrine\Tests\ORM\Functional;
use Doctrine\Tests\Models\Company\CompanyFixContract; use Doctrine\Tests\Models\Company\CompanyFixContract;
require_once __DIR__ . '/../../TestInit.php';
/** /**
* @group DDC-1955 * @group DDC-1955
*/ */

View file

@ -780,6 +780,16 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
//Inherited listeners //Inherited listeners
$this->assertEquals($fixClass->entityListeners, $superClass->entityListeners); $this->assertEquals($fixClass->entityListeners, $superClass->entityListeners);
$this->assertEquals($flexClass->entityListeners, $superClass->entityListeners); $this->assertEquals($flexClass->entityListeners, $superClass->entityListeners);
}
/**
* @group DDC-1955
*/
public function testEntityListenersOverride()
{
$em = $this->_getTestEntityManager();
$factory = $this->createClassMetadataFactory($em);
$ultraClass = $factory->getMetadataFor('Doctrine\Tests\Models\Company\CompanyFlexUltraContract');
//overrited listeners //overrited listeners
$this->assertArrayHasKey(Events::postPersist, $ultraClass->entityListeners); $this->assertArrayHasKey(Events::postPersist, $ultraClass->entityListeners);
@ -799,7 +809,7 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
$prePersist = $ultraClass->entityListeners[Events::prePersist][1]; $prePersist = $ultraClass->entityListeners[Events::prePersist][1];
$this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']); $this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']);
$this->assertEquals('prePersistHandler1', $prePersist['method']); $this->assertEquals('prePersistHandler1', $prePersist['method']);
$prePersist = $ultraClass->entityListeners[Events::prePersist][2]; $prePersist = $ultraClass->entityListeners[Events::prePersist][2];
$this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']); $this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']);
$this->assertEquals('prePersistHandler2', $prePersist['method']); $this->assertEquals('prePersistHandler2', $prePersist['method']);

View file

@ -4,8 +4,6 @@ namespace Doctrine\Tests\ORM\Mapping;
use Doctrine\ORM\Mapping\DefaultEntityListenerResolver; use Doctrine\ORM\Mapping\DefaultEntityListenerResolver;
require_once __DIR__ . '/../../TestInit.php';
/** /**
* @group DDC-1955 * @group DDC-1955
*/ */