This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
Tests/Unit/AutoRoute/RouteMaker Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,7 @@ protected function getAutoRouteForDocument($document)
97
97
98
98
protected function documentIsPersisted ($ document )
99
99
{
100
- $ metadata = $ this ->dm ->getClassMetadata (get_class ($ document ));
101
- $ id = $ metadata ->getIdentifierValue ($ document );
100
+ $ id = $ this ->dm ->getUnitOfWork ()->getDocumentId ($ document );
102
101
$ phpcrSession = $ this ->dm ->getPhpcrSession ();
103
102
return $ phpcrSession ->nodeExists ($ id );
104
103
}
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ public function setUp()
48
48
protected function setupDocumentPersisted ($ isPersisted )
49
49
{
50
50
$ this ->dm ->expects ($ this ->any ())
51
- ->method ('getClassMetadata ' )
52
- ->will ($ this ->returnValue ($ this ->metadata ));
51
+ ->method ('getUnitOfWork ' )
52
+ ->will ($ this ->returnValue ($ this ->uow ));
53
53
$ this ->dm ->expects ($ this ->once ())
54
54
->method ('getPhpcrSession ' )
55
55
->will ($ this ->returnValue ($ this ->phpcrSession ));
@@ -77,10 +77,6 @@ public function testCreateOrUpdateAutoRouteForExisting()
77
77
->method ('getContent ' )
78
78
->will ($ this ->returnValue ($ this ->doc ));
79
79
80
- $ this ->dm ->expects ($ this ->once ())
81
- ->method ('getUnitOfWork ' )
82
- ->will ($ this ->returnValue ($ this ->uow ));
83
-
84
80
$ this ->autoRouteStack ->expects ($ this ->once ())
85
81
->method ('addRoute ' )
86
82
->with ($ this ->autoRoute1 );
You can’t perform that action at this time.
0 commit comments