File tree Expand file tree Collapse file tree 4 files changed +23
-9
lines changed
src/Symfony/Bridge/Doctrine Expand file tree Collapse file tree 4 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 39
39
"ext-xml" : " *" ,
40
40
"friendsofphp/proxy-manager-lts" : " ^1.0.2" ,
41
41
"doctrine/event-manager" : " ^1.2|^2" ,
42
- "doctrine/persistence" : " ^2.5|^3.1" ,
42
+ "doctrine/persistence" : " ^2.5|^3.1|^4 " ,
43
43
"twig/twig" : " ^2.13|^3.0.4" ,
44
44
"psr/cache" : " ^2.0|^3.0" ,
45
45
"psr/clock" : " ^1.0" ,
Original file line number Diff line number Diff line change @@ -415,9 +415,13 @@ private function createRegistry(?ObjectManager $manager = null): ManagerRegistry
415
415
->method ('getManagerForClass ' )
416
416
->willReturn ($ manager );
417
417
418
- $ registry ->expects ($ this ->any ())
419
- ->method ('getManager ' )
420
- ->willReturn ($ manager );
418
+ if (null === $ manager ) {
419
+ $ registry ->method ('getManager ' )
420
+ ->willThrowException (new \InvalidArgumentException ());
421
+ } else {
422
+ $ registry ->method ('getManager ' )->willReturn ($ manager );
423
+ }
424
+
421
425
422
426
return $ registry ;
423
427
}
Original file line number Diff line number Diff line change @@ -76,10 +76,16 @@ protected function setUp(): void
76
76
protected function createRegistryMock ($ em = null )
77
77
{
78
78
$ registry = $ this ->createMock (ManagerRegistry::class);
79
- $ registry ->expects ($ this ->any ())
80
- ->method ('getManager ' )
81
- ->with ($ this ->equalTo (self ::EM_NAME ))
82
- ->willReturn ($ em );
79
+
80
+ if (null === $ em ) {
81
+ $ registry ->method ('getManager ' )
82
+ ->with ($ this ->equalTo (self ::EM_NAME ))
83
+ ->willThrowException (new \InvalidArgumentException ());
84
+ } else {
85
+ $ registry ->method ('getManager ' )
86
+ ->with ($ this ->equalTo (self ::EM_NAME ))
87
+ ->willReturn ($ em );
88
+ }
83
89
84
90
return $ registry ;
85
91
}
@@ -614,6 +620,10 @@ public function testValidateUniquenessWithArrayValue()
614
620
615
621
public function testDedicatedEntityManagerNullObject ()
616
622
{
623
+ if (method_exists (ObjectManager::class, 'isUninitializedObject ' )) {
624
+ $ this ->markTestSkipped ('This test is not applicable to persistence 4 ' );
625
+ }
626
+
617
627
$ constraint = new UniqueEntity ([
618
628
'message ' => 'myMessage ' ,
619
629
'fields ' => ['name ' ],
Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " >=8.1" ,
20
20
"doctrine/event-manager" : " ^1.2|^2" ,
21
- "doctrine/persistence" : " ^2.5|^3.1" ,
21
+ "doctrine/persistence" : " ^2.5|^3.1|^4 " ,
22
22
"symfony/deprecation-contracts" : " ^2.5|^3" ,
23
23
"symfony/polyfill-ctype" : " ~1.8" ,
24
24
"symfony/polyfill-mbstring" : " ~1.0" ,
You can’t perform that action at this time.
0 commit comments