1
0
mirror of synced 2024-12-13 14:56:01 +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'];
$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;
require_once __DIR__ . '/../../TestInit.php';
/**
* @group DDC-1955
*/

View File

@ -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']);

View File

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