Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getPaymentMethodEntity example
#[Package('checkout')]
class
PaymentMethodHandlerRuntimeFieldTest
extends
TestCase
{
public
function
testSynchronousRuntimeField
(
)
: void
{
$event
=
$this
->
createMock
(
EntityLoadedEvent::
class
)
;
$event
->
method
(
'getEntities'
)
->
willReturn
(
$this
->
getPaymentMethodEntity
(
$this
->
createMock
(
SynchronousPaymentHandlerInterface::
class
)
::
class
D
)
;
(
new
PaymentHandlerIdentifierSubscriber
(
)
)
->
formatHandlerIdentifier
(
$event
)
;
static
::
assertCount
(
1,
$event
->
getEntities
(
)
)
;
/** @var PaymentMethodEntity $paymentMethod */
$paymentMethod
=
$event
->
getEntities
(
)
[
0
]
;
static
::
assertTrue
(
$paymentMethod
->
isSynchronous
(
)
)
;