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