WriteContext::
createFromContext(Context::
createDefaultContext()) );
$deleted =
$result->
getDeleted();
static::
assertCount(1,
$deleted);
static::
assertArrayHasKey(SetNullOnDeleteParentDefinition::ENTITY_NAME,
$deleted);
static::
assertCount(1,
$deleted[SetNullOnDeleteParentDefinition::ENTITY_NAME
]);
static::
assertEquals($ids->
get('parent'
),
$deleted[SetNullOnDeleteParentDefinition::ENTITY_NAME
][0
]->
getPrimaryKey());
$updated =
$result->
getWritten();
static::
assertCount(1,
$updated);
static::
assertArrayHasKey(SetNullOnDeleteChildDefinition::ENTITY_NAME,
$updated);
static::
assertCount(1,
$updated[SetNullOnDeleteChildDefinition::ENTITY_NAME
]);
/** @var EntityWriteResult $updateResult */
$updateResult =
$updated[SetNullOnDeleteChildDefinition::ENTITY_NAME
][0
];
static::
assertEquals($ids->
get('child'
),
$updateResult->
getPrimaryKey());
static::
assertEquals([ 'id' =>
$ids->
get('child'
),
'setNullOnDeleteParentId' => null,
'setNullOnDeleteParentVersionId' => null,
],