Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
VersionCommitDataCollection example
$lock
=
$this
->
createMock
(
LockInterface::
class
)
;
$lock
->
method
(
'acquire'
)
->
willReturn
(
true
)
;
$lockFactory
->
expects
(
static
::
once
(
)
)
->
method
(
'createLock'
)
->
willReturn
(
$lock
)
;
$versionCommit
=
new
VersionCommitEntity
(
)
;
$versionCommitData
=
new
VersionCommitDataEntity
(
)
;
$versionCommitData
->
setAction
(
'insert'
)
;
$versionCommitData
->
setId
(
Uuid::
randomHex
(
)
)
;
$versionCommitData
->
setEntityName
(
'product'
)
;
$versionCommitData
->
setEntityId
(
[
Uuid::
randomHex
(
)
]
)
;
$versionCommit
->
setData
(
new
VersionCommitDataCollection
(
[
$versionCommitData
]
)
)
;
$versionCommit
->
setId
(
Uuid::
randomHex
(
)
)
;
$entityReaderMock
->
expects
(
static
::
once
(
)
)
->
method
(
'read'
)
->
willReturn
(
new
VersionCommitCollection
(
[
$versionCommit
]
)
)
;
$writeContextMock
=
$this
->
createMock
(
WriteContext::
class
)
;
$this
->versionManager->
merge
(
Uuid::
randomHex
(
)
,
$writeContextMock
)
;
}