Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
LockStoreSchemaListener example
$entityManager
=
$this
->
createMock
(
EntityManagerInterface::
class
)
;
$entityManager
->
expects
(
$this
->
once
(
)
)
->
method
(
'getConnection'
)
->
willReturn
(
$dbalConnection
)
;
$event
=
new
GenerateSchemaEventArgs
(
$entityManager
,
$schema
)
;
$lockStore
=
$this
->
createMock
(
DoctrineDbalStore::
class
)
;
$lockStore
->
expects
(
$this
->
once
(
)
)
->
method
(
'configureSchema'
)
->
with
(
$schema
,
fn
(
)
=> true
)
;
$subscriber
=
new
LockStoreSchemaListener
(
[
$lockStore
]
)
;
$subscriber
->
postGenerateSchema
(
$event
)
;
}
}