File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1717use Neos \ContentRepository \Domain \Service \NodeTypeManager ;
1818use Neos \ContentRepository \Exception \NodeTypeNotFoundException ;
1919use Neos \Flow \Annotations as Flow ;
20+ use Neos \Flow \Persistence \Doctrine \PersistenceManager ;
2021
2122/**
2223 * @Flow\Scope("singleton")
@@ -35,6 +36,12 @@ class FakeNodeDataFactory
3536 */
3637 protected $ nodeTypeManager ;
3738
39+ /**
40+ * @var PersistenceManager
41+ * @Flow\Inject
42+ */
43+ protected $ persistenceManager ;
44+
3845 /**
3946 * This creates a "fake" removed NodeData instance from the given payload
4047 *
@@ -74,6 +81,11 @@ public function createFromPayload(array $payload)
7481
7582 $ nodeData ->setRemoved (true );
7683
84+ // Ensure, the fake-node is not persisted
85+ if ($ this ->persistenceManager ->isNewObject ($ nodeData )) {
86+ $ this ->persistenceManager ->remove ($ nodeData );
87+ }
88+
7789 return $ nodeData ;
7890 }
7991}
You can’t perform that action at this time.
0 commit comments