public function testOnEntityWritten(): void
{ $context = Context::
createDefaultContext();
$idA = Uuid::
randomHex();
$idB = Uuid::
randomBytes();
$idC = Uuid::
randomBytes();
$idD = Uuid::
randomBytes();
$event =
new EntityWrittenContainerEvent($context,
new NestedEventCollection([ new EntityWrittenEvent('many_to_one',
[ new EntityWriteResult($idA,
[], 'many_to_one', EntityWriteResult::OPERATION_INSERT
),
],
$context,
[]),
new EntityWrittenEvent('one_to_many',
[ new EntityWriteResult($idA,
['ruleId' =>
$idA], 'one_to_many', EntityWriteResult::OPERATION_INSERT
),
new EntityWriteResult($idA,
[], 'one_to_many', EntityWriteResult::OPERATION_UPDATE, null,
new ChangeSet( ['rule_id' =>
$idB],
['rule_id' =>
$idC],
false
)),
new EntityWriteResult($idA,
[], 'one_to_many', EntityWriteResult::OPERATION_DELETE, null,
new ChangeSet( ['rule_id' =>
$idD],
['rule_id' => null
],