Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CollectionBusinessEvent example
$tax
=
new
TaxEntity
(
)
;
$tax
->
setId
(
'tax-id'
)
;
$tax
->
setName
(
'test'
)
;
$tax
->
setTaxRate
(
19
)
;
$tax
->
setPosition
(
1
)
;
yield
'ScalarBusinessEvent' =>
[
new
ScalarBusinessEvent
(
)
]
;
yield
'StructuredObjectBusinessEvent' =>
[
new
StructuredObjectBusinessEvent
(
)
]
;
yield
'StructuredArrayObjectBusinessEvent' =>
[
new
StructuredArrayObjectBusinessEvent
(
)
]
;
yield
'UnstructuredObjectBusinessEvent' =>
[
new
UnstructuredObjectBusinessEvent
(
)
]
;
yield
'EntityBusinessEvent' =>
[
new
EntityBusinessEvent
(
$tax
)
]
;
yield
'CollectionBusinessEvent' =>
[
new
CollectionBusinessEvent
(
new
TaxCollection
(
[
$tax
]
)
)
]
;
yield
'ArrayBusinessEvent' =>
[
new
ArrayBusinessEvent
(
new
TaxCollection
(
[
$tax
]
)
)
]
;
yield
'NestedEntityBusinessEvent' =>
[
new
NestedEntityBusinessEvent
(
$tax
)
]
;
}
public
function
testInvalidType
(
)
: void
{
static
::
expectException
(
\RuntimeException::
class
)
;
$this
->businessEventEncoder->
encode
(
new
InvalidTypeBusinessEvent
(
)
)
;
}
public
function
testInvalidAvailableData
(
)
: void
{
public
static
function
getEventsWithPermissions
(
)
: array
{
$tax
=
new
TaxEntity
(
)
;
$tax
->
setId
(
'tax-id'
)
;
$tax
->
setName
(
'test'
)
;
$tax
->
setTaxRate
(
19
)
;
$tax
->
setPosition
(
1
)
;
return
[
[
new
EntityBusinessEvent
(
$tax
)
]
,
[
new
CollectionBusinessEvent
(
new
TaxCollection
(
[
$tax
]
)
)
]
,
[
new
ArrayBusinessEvent
(
new
TaxCollection
(
[
$tax
]
)
)
]
,
[
new
NestedEntityBusinessEvent
(
$tax
)
]
,
]
;
}
}