Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
VersionCommitDataEntity example
$this
->
createMock
(
VersionCommitDefinition::
class
)
,
$this
->
createMock
(
VersionCommitDataDefinition::
class
)
,
$this
->
createMock
(
VersionDefinition::
class
)
,
$lockFactory
)
;
$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
)
;