Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
PaymentMethodDefinition example
public
function
testFormatHandlerIdentifier
(
)
: void
{
$paymentMethods
=
[
$this
->
getPaymentMethod
(
)
,
$this
->
getPaymentMethod
(
AsynchronousPaymentHandlerInterface::
class
)
,
$this
->
getPaymentMethod
(
RefundPaymentHandlerInterface::
class
)
,
$this
->
getPaymentMethod
(
PreparedPaymentHandlerInterface::
class
)
,
$this
->
getPaymentMethod
(
RecurringPaymentHandlerInterface::
class
)
,
]
;
$event
=
new
EntityLoadedEvent
(
new
PaymentMethodDefinition
(
)
,
$paymentMethods
,
Context::
createDefaultContext
(
)
)
;
$subscriber
=
new
PaymentHandlerIdentifierSubscriber
(
)
;
$subscriber
->
formatHandlerIdentifier
(
$event
)
;
/** @var array<PaymentMethodEntity> $methods */
$methods
=
$event
->
getEntities
(
)
;
static
::
assertContainsOnly
(
PaymentMethodEntity::
class
,
$methods
)
;