$this->
getContainer()->
get('product.repository'
) ->
update([['id' =>
$ids->
get('p1'
), 'name' => 'test'
]],
$versionContext);
// now ensure that we get a validate event for the merge request
$called = false;
$this->
addEventListener( $this->
getContainer()->
get('event_dispatcher'
),
PreWriteValidationEvent::
class,
function DPreWriteValidationEvent
$event) use (&
$called): void
{ // we also get a validation event for the version tables
if (!
$event->
getPrimaryKeys('product'
)) { return;
} $called = true;
// some validators depend on that to disable insert/update validation for merge requests
static::
assertTrue($event->
getWriteContext()->
hasState(VersionManager::MERGE_SCOPE
));
} );
$this->
getContainer()->
get('product.repository'
)->
merge($versionId,
$context);