Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename subscribers to listeners

  • Loading branch information...
commit a2655113689d12f60db6d2dae496a7e68bc0def0 1 parent 46474bf
@FabioBatSilva authored fabio.silva committed
View
18 tests/Doctrine/Tests/Models/Company/CompanyContract.php
@@ -7,7 +7,7 @@
* @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 @@ static public function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $met
"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');
}
}
View
2  ...trine/Tests/Models/Company/ContractSubscriber.php → .../Tests/Models/Company/CompanyContractListener.php
@@ -2,7 +2,7 @@
namespace Doctrine\Tests\Models\Company;
-class ContractSubscriber
+class CompanyContractListener
{
static public $postPersistCalls;
static public $prePersistCalls;
View
22 tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php
@@ -4,7 +4,7 @@
/**
* @Entity
- * @EntityListeners({"ContractSubscriber","FlexUltraContractSubscriber"})
+ * @EntityListeners({"CompanyContractListener","CompanyFlexUltraContractListener"})
*/
class CompanyFlexUltraContract extends CompanyFlexContract
{
@@ -36,19 +36,19 @@ static public function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $met
'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');
}
}
View
2  ...ts/Models/Company/FlexUltraContractSubscriber.php → ...dels/Company/CompanyFlexUltraContractListener.php
@@ -4,7 +4,7 @@
use Doctrine\ORM\Event\LifecycleEventArgs;
-class FlexUltraContractSubscriber
+class CompanyFlexUltraContractListener
{
static public $prePersistCalls;
static public $instances;
View
98 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 @@ public function testPreFlushListeners()
$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 @@ public function testPostLoadListeners()
$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 @@ public function testPrePersistListeners()
$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 @@ public function testPostPersistListeners()
$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 @@ public function testPreUpdateListeners()
$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 @@ public function testPostUpdateListeners()
$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 @@ public function testPreRemoveListeners()
$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 @@ public function testPostRemoveListeners()
$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]
);
}
}
View
50 tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php
@@ -6,8 +6,8 @@
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 @@ public function testEntityListeners()
$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 @@ public function testEntityListeners()
$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 @@ public function testCallEntityListeners()
$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 @@ public function testCallEntityListeners()
$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);
}
/**
View
4 tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
@@ -1016,14 +1016,14 @@ public function testInvalidEntityListenerClassException()
* @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');
}
}
View
16 tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyContract.php
@@ -27,14 +27,14 @@
"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');
View
20 tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.php
@@ -5,17 +5,17 @@
'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');
View
2  tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml
@@ -14,7 +14,7 @@
</discriminator-map>
<entity-listeners>
- <entity-listener class="ContractSubscriber">
+ <entity-listener class="CompanyContractListener">
<pre-flush method="preFlushHandler"/>
<post-load method="postLoadHandler"/>
View
4 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml
@@ -8,7 +8,7 @@
<entity name="Doctrine\Tests\Models\Company\CompanyFlexUltraContract">
<entity-listeners>
- <entity-listener class="ContractSubscriber">
+ <entity-listener class="CompanyContractListener">
<pre-flush method="preFlushHandler"/>
<post-load method="postLoadHandler"/>
<pre-persist method="prePersistHandler"/>
@@ -19,7 +19,7 @@
<post-remove method="postRemoveHandler"/>
</entity-listener>
- <entity-listener class="FlexUltraContractSubscriber">
+ <entity-listener class="CompanyFlexUltraContractListener">
<pre-persist method="prePersistHandler1"/>
<pre-persist method="prePersistHandler2"/>
</entity-listener>
View
2  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]
View
4 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]
Please sign in to comment.
Something went wrong with that request. Please try again.