$children =
$this->connection->
fetchAllAssociative('SELECT * FROM set_null_on_delete_child'
);
static::
assertCount(1,
$children);
$result =
$this->writer->
delete( $this->
getContainer()->
get(SetNullOnDeleteParentDefinition::
class),
[ ['id' =>
$ids->
get('parent'
)],
],
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
]);