Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
MyEntityDefinition example
$entity
->
setName
(
'test'
)
;
$entity
->
setDescription
(
'test'
)
;
$entity
->
setTranslated
(
[
'name' => 'test',
'description' => 'test',
]
)
;
$registry
=
$this
->
createMock
(
DefinitionRegistryChain::
class
)
;
$registry
->
method
(
'has'
)
->
willReturn
(
true
)
;
$definition
=
new
MyEntityDefinition
(
)
;
$definition
->
compile
(
$this
->
getContainer
(
)
->
get
(
DefinitionInstanceRegistry::
class
)
)
;
$registry
->
method
(
'getByEntityName'
)
->
willReturn
(
$definition
)
;
$encoder
=
new
StructEncoder
(
$registry
,
$this
->
getContainer
(
)
->
get
(
'serializer'
)
)
;