15
15
16
16
use function uniqid ;
17
17
18
- /**
19
- * PrePersistEventTest
20
- */
21
18
class PrePersistEventTest extends OrmFunctionalTestCase
22
19
{
23
20
protected function setUp (): void
24
21
{
25
22
parent ::setUp ();
26
23
27
24
$ this ->createSchemaForModels (
28
- EntityWithUnmapEntity ::class,
25
+ EntityWithUnmappedEntity ::class,
29
26
EntityWithCascadeAssociation::class
30
27
);
31
28
}
32
29
33
30
public function testCallingPersistInPrePersistHook (): void
34
31
{
35
- $ entityWithUnmapped = new EntityWithUnmapEntity ();
32
+ $ entityWithUnmapped = new EntityWithUnmappedEntity ();
36
33
$ entityWithCascade = new EntityWithCascadeAssociation ();
37
34
38
35
$ entityWithUnmapped ->unmapped = $ entityWithCascade ;
@@ -52,7 +49,7 @@ public function prePersist(PrePersistEventArgs $args): void
52
49
{
53
50
$ object = $ args ->getObject ();
54
51
55
- if ($ object instanceof EntityWithUnmapEntity ) {
52
+ if ($ object instanceof EntityWithUnmappedEntity ) {
56
53
$ uow = $ args ->getObjectManager ()->getUnitOfWork ();
57
54
58
55
if ($ object ->unmapped && ! $ uow ->isInIdentityMap ($ object ->unmapped ) && ! $ uow ->isScheduledForInsert ($ object ->unmapped )) {
@@ -64,7 +61,7 @@ public function prePersist(PrePersistEventArgs $args): void
64
61
65
62
/** @Entity */
66
63
#[Entity]
67
- class EntityWithUnmapEntity
64
+ class EntityWithUnmappedEntity
68
65
{
69
66
/**
70
67
* @var string
@@ -102,10 +99,10 @@ class EntityWithCascadeAssociation
102
99
public $ id ;
103
100
104
101
/**
105
- * @var ?EntityWithUnmapEntity
106
- * @ManyToOne(targetEntity=EntityWithUnmapEntity ::class, cascade={"persist"})
102
+ * @var ?EntityWithUnmappedEntity
103
+ * @ManyToOne(targetEntity=EntityWithUnmappedEntity ::class, cascade={"persist"})
107
104
*/
108
- #[ManyToOne(targetEntity: EntityWithUnmapEntity ::class, cascade: ['persist ' ])]
105
+ #[ManyToOne(targetEntity: EntityWithUnmappedEntity ::class, cascade: ['persist ' ])]
109
106
public $ cascaded = null ;
110
107
111
108
public function __construct ()
0 commit comments