split override test
This commit is contained in:
parent
0d0fc320b4
commit
7b0f59ed7c
@ -72,7 +72,7 @@ class ListenersInvoker
|
||||
$method = $listener['method'];
|
||||
$instance = $this->resolver->resolve($class);
|
||||
|
||||
$instance->{$method}($entity, $event);
|
||||
$instance->$method($entity, $event);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,8 +4,6 @@ namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\Tests\Models\Company\CompanyFixContract;
|
||||
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* @group DDC-1955
|
||||
*/
|
||||
|
@ -780,6 +780,16 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
//Inherited listeners
|
||||
$this->assertEquals($fixClass->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
|
||||
$this->assertArrayHasKey(Events::postPersist, $ultraClass->entityListeners);
|
||||
@ -799,7 +809,7 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
|
||||
$prePersist = $ultraClass->entityListeners[Events::prePersist][1];
|
||||
$this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']);
|
||||
$this->assertEquals('prePersistHandler1', $prePersist['method']);
|
||||
|
||||
|
||||
$prePersist = $ultraClass->entityListeners[Events::prePersist][2];
|
||||
$this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']);
|
||||
$this->assertEquals('prePersistHandler2', $prePersist['method']);
|
||||
|
@ -4,8 +4,6 @@ namespace Doctrine\Tests\ORM\Mapping;
|
||||
|
||||
use Doctrine\ORM\Mapping\DefaultEntityListenerResolver;
|
||||
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* @group DDC-1955
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user