diff --git a/tests/Doctrine/Tests/Models/Company/CompanyContract.php b/tests/Doctrine/Tests/Models/Company/CompanyContract.php index 4fd6d92d0..139098274 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyContract.php @@ -7,7 +7,7 @@ namespace Doctrine\Tests\Models\Company; * @Table(name="company_contracts") * @InheritanceType("SINGLE_TABLE") * @DiscriminatorColumn(name="discr", type="string") - * @EntityListeners({"ContractSubscriber"}) + * @EntityListeners({"CompanyContractListener"}) * @DiscriminatorMap({ * "fix" = "CompanyFixContract", * "flexible" = "CompanyFlexContract", @@ -157,16 +157,16 @@ abstract class CompanyContract "flexultra" => "CompanyFlexUltraContract" )); - $metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); } } diff --git a/tests/Doctrine/Tests/Models/Company/ContractSubscriber.php b/tests/Doctrine/Tests/Models/Company/CompanyContractListener.php similarity index 98% rename from tests/Doctrine/Tests/Models/Company/ContractSubscriber.php rename to tests/Doctrine/Tests/Models/Company/CompanyContractListener.php index 64e953a34..9382660bc 100644 --- a/tests/Doctrine/Tests/Models/Company/ContractSubscriber.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyContractListener.php @@ -2,7 +2,7 @@ namespace Doctrine\Tests\Models\Company; -class ContractSubscriber +class CompanyContractListener { static public $postPersistCalls; static public $prePersistCalls; diff --git a/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php index d193d07d9..85126bd0e 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Company; /** * @Entity - * @EntityListeners({"ContractSubscriber","FlexUltraContractSubscriber"}) + * @EntityListeners({"CompanyContractListener","CompanyFlexUltraContractListener"}) */ class CompanyFlexUltraContract extends CompanyFlexContract { @@ -36,19 +36,19 @@ class CompanyFlexUltraContract extends CompanyFlexContract 'name' => 'maxPrice', 'fieldName' => 'maxPrice', )); - $metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); + $metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); - $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler1'); - $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler2'); + $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler1'); + $metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler2'); } } \ No newline at end of file diff --git a/tests/Doctrine/Tests/Models/Company/FlexUltraContractSubscriber.php b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContractListener.php similarity index 94% rename from tests/Doctrine/Tests/Models/Company/FlexUltraContractSubscriber.php rename to tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContractListener.php index 408bcad70..04f2dd2ea 100644 --- a/tests/Doctrine/Tests/Models/Company/FlexUltraContractSubscriber.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContractListener.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\Models\Company; use Doctrine\ORM\Event\LifecycleEventArgs; -class FlexUltraContractSubscriber +class CompanyFlexUltraContractListener { static public $prePersistCalls; static public $instances; diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php index 857fe7383..dcc8393e0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php @@ -3,7 +3,7 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Tests\Models\Company\CompanyFixContract; -use Doctrine\Tests\Models\Company\ContractSubscriber; +use Doctrine\Tests\Models\Company\CompanyContractListener; require_once __DIR__ . '/../../TestInit.php'; @@ -24,24 +24,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $fix = new CompanyFixContract(); $fix->setFixPrice(2000); - ContractSubscriber::$preFlushCalls = array(); + CompanyContractListener::$preFlushCalls = array(); $this->_em->persist($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$preFlushCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$preFlushCalls); - $this->assertSame($fix, ContractSubscriber::$preFlushCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$preFlushCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$preFlushCalls[0][0] + CompanyContractListener::$preFlushCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\PreFlushEventArgs', - ContractSubscriber::$preFlushCalls[0][1] + CompanyContractListener::$preFlushCalls[0][1] ); } @@ -54,24 +54,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->flush(); $this->_em->clear(); - ContractSubscriber::$postLoadCalls = array(); + CompanyContractListener::$postLoadCalls = array(); $dql = "SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1"; $fix = $this->_em->createQuery($dql)->setParameter(1, $fix->getId())->getSingleResult(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$postLoadCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$postLoadCalls); - $this->assertSame($fix, ContractSubscriber::$postLoadCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$postLoadCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$postLoadCalls[0][0] + CompanyContractListener::$postLoadCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$postLoadCalls[0][1] + CompanyContractListener::$postLoadCalls[0][1] ); } @@ -80,24 +80,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $fix = new CompanyFixContract(); $fix->setFixPrice(2000); - ContractSubscriber::$prePersistCalls = array(); + CompanyContractListener::$prePersistCalls = array(); $this->_em->persist($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$prePersistCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$prePersistCalls); - $this->assertSame($fix, ContractSubscriber::$prePersistCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$prePersistCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$prePersistCalls[0][0] + CompanyContractListener::$prePersistCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$prePersistCalls[0][1] + CompanyContractListener::$prePersistCalls[0][1] ); } @@ -106,24 +106,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $fix = new CompanyFixContract(); $fix->setFixPrice(2000); - ContractSubscriber::$postPersistCalls = array(); + CompanyContractListener::$postPersistCalls = array(); $this->_em->persist($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$postPersistCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$postPersistCalls); - $this->assertSame($fix, ContractSubscriber::$postPersistCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$postPersistCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$postPersistCalls[0][0] + CompanyContractListener::$postPersistCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$postPersistCalls[0][1] + CompanyContractListener::$postPersistCalls[0][1] ); } @@ -135,26 +135,26 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($fix); $this->_em->flush(); - ContractSubscriber::$preUpdateCalls = array(); + CompanyContractListener::$preUpdateCalls = array(); $fix->setFixPrice(2000); $this->_em->persist($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$preUpdateCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$preUpdateCalls); - $this->assertSame($fix, ContractSubscriber::$preUpdateCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$preUpdateCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$preUpdateCalls[0][0] + CompanyContractListener::$preUpdateCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\PreUpdateEventArgs', - ContractSubscriber::$preUpdateCalls[0][1] + CompanyContractListener::$preUpdateCalls[0][1] ); } @@ -166,26 +166,26 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($fix); $this->_em->flush(); - ContractSubscriber::$postUpdateCalls = array(); + CompanyContractListener::$postUpdateCalls = array(); $fix->setFixPrice(2000); $this->_em->persist($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$postUpdateCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$postUpdateCalls); - $this->assertSame($fix, ContractSubscriber::$postUpdateCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$postUpdateCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$postUpdateCalls[0][0] + CompanyContractListener::$postUpdateCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$postUpdateCalls[0][1] + CompanyContractListener::$postUpdateCalls[0][1] ); } @@ -197,24 +197,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($fix); $this->_em->flush(); - ContractSubscriber::$preRemoveCalls = array(); + CompanyContractListener::$preRemoveCalls = array(); $this->_em->remove($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$preRemoveCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$preRemoveCalls); - $this->assertSame($fix, ContractSubscriber::$preRemoveCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$preRemoveCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$preRemoveCalls[0][0] + CompanyContractListener::$preRemoveCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$preRemoveCalls[0][1] + CompanyContractListener::$preRemoveCalls[0][1] ); } @@ -226,24 +226,24 @@ class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->persist($fix); $this->_em->flush(); - ContractSubscriber::$postRemoveCalls = array(); + CompanyContractListener::$postRemoveCalls = array(); $this->_em->remove($fix); $this->_em->flush(); - $this->assertCount(1,ContractSubscriber::$instances); - $this->assertCount(1,ContractSubscriber::$postRemoveCalls); + $this->assertCount(1,CompanyContractListener::$instances); + $this->assertCount(1,CompanyContractListener::$postRemoveCalls); - $this->assertSame($fix, ContractSubscriber::$postRemoveCalls[0][0]); + $this->assertSame($fix, CompanyContractListener::$postRemoveCalls[0][0]); $this->assertInstanceOf( 'Doctrine\Tests\Models\Company\CompanyFixContract', - ContractSubscriber::$postRemoveCalls[0][0] + CompanyContractListener::$postRemoveCalls[0][0] ); $this->assertInstanceOf( 'Doctrine\ORM\Event\LifecycleEventArgs', - ContractSubscriber::$postRemoveCalls[0][1] + CompanyContractListener::$postRemoveCalls[0][1] ); } } \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index dc8030f20..e4a9e0530 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -6,8 +6,8 @@ use Doctrine\ORM\Events; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\Tests\Models\Company\CompanyFixContract; use Doctrine\Tests\Models\Company\CompanyFlexContract; -use Doctrine\Tests\Models\Company\ContractSubscriber; -use Doctrine\Tests\Models\Company\FlexUltraContractSubscriber; +use Doctrine\Tests\Models\Company\CompanyContractListener; +use Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataInfo; @@ -774,8 +774,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase $postPersist = $superClass->entityListeners[Events::postPersist][0]; $prePersist = $superClass->entityListeners[Events::prePersist][0]; - $this->assertEquals('Doctrine\Tests\Models\Company\ContractSubscriber', $postPersist['class']); - $this->assertEquals('Doctrine\Tests\Models\Company\ContractSubscriber', $prePersist['class']); + $this->assertEquals('Doctrine\Tests\Models\Company\CompanyContractListener', $postPersist['class']); + $this->assertEquals('Doctrine\Tests\Models\Company\CompanyContractListener', $prePersist['class']); $this->assertEquals('postPersistHandler', $postPersist['method']); $this->assertEquals('prePersistHandler', $prePersist['method']); @@ -793,17 +793,17 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase $postPersist = $ultraClass->entityListeners[Events::postPersist][0]; $prePersist = $ultraClass->entityListeners[Events::prePersist][0]; - $this->assertEquals('Doctrine\Tests\Models\Company\ContractSubscriber', $postPersist['class']); - $this->assertEquals('Doctrine\Tests\Models\Company\ContractSubscriber', $prePersist['class']); + $this->assertEquals('Doctrine\Tests\Models\Company\CompanyContractListener', $postPersist['class']); + $this->assertEquals('Doctrine\Tests\Models\Company\CompanyContractListener', $prePersist['class']); $this->assertEquals('postPersistHandler', $postPersist['method']); $this->assertEquals('prePersistHandler', $prePersist['method']); $prePersist = $ultraClass->entityListeners[Events::prePersist][1]; - $this->assertEquals('Doctrine\Tests\Models\Company\FlexUltraContractSubscriber', $prePersist['class']); + $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\FlexUltraContractSubscriber', $prePersist['class']); + $this->assertEquals('Doctrine\Tests\Models\Company\CompanyFlexUltraContractListener', $prePersist['class']); $this->assertEquals('prePersistHandler2', $prePersist['method']); } @@ -818,9 +818,9 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase $fixClass = $factory->getMetadataFor('Doctrine\Tests\Models\Company\CompanyFlexContract'); $ultraClass = $factory->getMetadataFor('Doctrine\Tests\Models\Company\CompanyFlexUltraContract'); - ContractSubscriber::$prePersistCalls = array(); - ContractSubscriber::$postPersistCalls = array(); - FlexUltraContractSubscriber::$prePersistCalls = array(); + CompanyContractListener::$prePersistCalls = array(); + CompanyContractListener::$postPersistCalls = array(); + CompanyFlexUltraContractListener::$prePersistCalls = array(); $fix = new CompanyFixContract(); $fixArg = new LifecycleEventArgs($fix, $em); @@ -835,26 +835,26 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase $flexClass->dispatchEntityListeners(Events::prePersist, $flex, $flexArg); $ultraClass->dispatchEntityListeners(Events::prePersist, $ultra, $ultraArg); - $this->assertCount(3, ContractSubscriber::$prePersistCalls); - $this->assertCount(2, FlexUltraContractSubscriber::$prePersistCalls); + $this->assertCount(3, CompanyContractListener::$prePersistCalls); + $this->assertCount(2, CompanyFlexUltraContractListener::$prePersistCalls); - $this->assertSame($fix, ContractSubscriber::$prePersistCalls[0][0]); - $this->assertSame($fixArg, ContractSubscriber::$prePersistCalls[0][1]); + $this->assertSame($fix, CompanyContractListener::$prePersistCalls[0][0]); + $this->assertSame($fixArg, CompanyContractListener::$prePersistCalls[0][1]); - $this->assertSame($flex, ContractSubscriber::$prePersistCalls[1][0]); - $this->assertSame($flexArg, ContractSubscriber::$prePersistCalls[1][1]); + $this->assertSame($flex, CompanyContractListener::$prePersistCalls[1][0]); + $this->assertSame($flexArg, CompanyContractListener::$prePersistCalls[1][1]); - $this->assertSame($ultra, ContractSubscriber::$prePersistCalls[2][0]); - $this->assertSame($ultraArg, ContractSubscriber::$prePersistCalls[2][1]); + $this->assertSame($ultra, CompanyContractListener::$prePersistCalls[2][0]); + $this->assertSame($ultraArg, CompanyContractListener::$prePersistCalls[2][1]); - $this->assertSame($ultra, FlexUltraContractSubscriber::$prePersistCalls[0][0]); - $this->assertSame($ultraArg, FlexUltraContractSubscriber::$prePersistCalls[0][1]); + $this->assertSame($ultra, CompanyFlexUltraContractListener::$prePersistCalls[0][0]); + $this->assertSame($ultraArg, CompanyFlexUltraContractListener::$prePersistCalls[0][1]); - $this->assertSame($ultra, FlexUltraContractSubscriber::$prePersistCalls[1][0]); - $this->assertSame($ultraArg, FlexUltraContractSubscriber::$prePersistCalls[1][1]); + $this->assertSame($ultra, CompanyFlexUltraContractListener::$prePersistCalls[1][0]); + $this->assertSame($ultraArg, CompanyFlexUltraContractListener::$prePersistCalls[1][1]); - $this->assertCount(1, ContractSubscriber::$instances); - $this->assertEmpty(ContractSubscriber::$postPersistCalls); + $this->assertCount(1, CompanyContractListener::$instances); + $this->assertEmpty(CompanyContractListener::$postPersistCalls); } /** diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 2f79b967c..41f2ffa2f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -1016,14 +1016,14 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase * @group DDC-1955 * * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Entity Listener "\Doctrine\Tests\Models\Company\ContractSubscriber" declared on "Doctrine\Tests\Models\CMS\CmsUser" has no method "invalidMethod". + * @expectedExceptionMessage Entity Listener "\Doctrine\Tests\Models\Company\CompanyContractListener" declared on "Doctrine\Tests\Models\CMS\CmsUser" has no method "invalidMethod". */ public function testInvalidEntityListenerMethodException() { $cm = new ClassMetadata('Doctrine\Tests\Models\CMS\CmsUser'); $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); - $cm->addEntityListener(Events::postLoad, '\Doctrine\Tests\Models\Company\ContractSubscriber', 'invalidMethod'); + $cm->addEntityListener(Events::postLoad, '\Doctrine\Tests\Models\Company\CompanyContractListener', 'invalidMethod'); } } diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php index 636b952c9..fdb8d5d02 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php @@ -27,14 +27,14 @@ $metadata->setDiscriminatorMap(array( "flexultra" => "CompanyFlexUltraContract" )); -$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler'); \ No newline at end of file +$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php index 31e4b60c0..d16d4f3f5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php @@ -5,17 +5,17 @@ $metadata->mapField(array( 'name' => 'maxPrice', 'fieldName' => 'maxPrice', )); -$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'ContractSubscriber', 'postPersistHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'ContractSubscriber', 'prePersistHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postPersist, 'CompanyContractListener', 'postPersistHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyContractListener', 'prePersistHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'ContractSubscriber', 'postUpdateHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'ContractSubscriber', 'preUpdateHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postUpdate, 'CompanyContractListener', 'postUpdateHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::preUpdate, 'CompanyContractListener', 'preUpdateHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'ContractSubscriber', 'postRemoveHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'ContractSubscriber', 'preRemoveHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postRemove, 'CompanyContractListener', 'postRemoveHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::preRemove, 'CompanyContractListener', 'preRemoveHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'ContractSubscriber', 'preFlushHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'ContractSubscriber', 'postLoadHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::preFlush, 'CompanyContractListener', 'preFlushHandler'); +$metadata->addEntityListener(\Doctrine\ORM\Events::postLoad, 'CompanyContractListener', 'postLoadHandler'); -$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler1'); -$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'FlexUltraContractSubscriber', 'prePersistHandler2'); \ No newline at end of file +$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler1'); +$metadata->addEntityListener(\Doctrine\ORM\Events::prePersist, 'CompanyFlexUltraContractListener', 'prePersistHandler2'); \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml index c4fc7adc8..4f5f843eb 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml @@ -14,7 +14,7 @@ - + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml index bbe0899f6..e76483736 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml @@ -8,7 +8,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml index bdad810c7..e738569e5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml @@ -9,7 +9,7 @@ Doctrine\Tests\Models\Company\CompanyContract: entityListeners: listener[0]: - class : ContractSubscriber + class : CompanyContractListener preFlush: [preFlushHandler] postLoad: [postLoadHandler] diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml index 1621a6a84..a72e5de38 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml @@ -3,7 +3,7 @@ Doctrine\Tests\Models\Company\CompanyFlexUltraContract: entityListeners: listener[0]: - class : ContractSubscriber + class : CompanyContractListener preFlush: [preFlushHandler] postLoad: [postLoadHandler] @@ -18,7 +18,7 @@ Doctrine\Tests\Models\Company\CompanyFlexUltraContract: preRemove: [preRemoveHandler] listener[1]: - class : FlexUltraContractSubscriber + class : CompanyFlexUltraContractListener prePersist: [prePersistHandler1, prePersistHandler2]