function PaymentReferenceTest::testCreate in Payment 8.2
Same name in this branch
- 8.2 modules/payment_reference/tests/src/Unit/Element/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Element\PaymentReferenceTest::testCreate()
- 8.2 modules/payment_reference/tests/src/Unit/Plugin/Payment/Type/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Plugin\Payment\Type\PaymentReferenceTest::testCreate()
- 8.2 modules/payment_reference/tests/src/Unit/Plugin/Field/FieldWidget/PaymentReferenceTest.php \Drupal\Tests\payment_reference\Unit\Plugin\Field\FieldWidget\PaymentReferenceTest::testCreate()
@covers ::create @covers ::__construct
File
- modules/
payment_reference/ tests/ src/ Unit/ Plugin/ Payment/ Type/ PaymentReferenceTest.php, line 92
Class
- PaymentReferenceTest
- @coversDefaultClass \Drupal\payment_reference\Plugin\Payment\Type\PaymentReference
Namespace
Drupal\Tests\payment_reference\Unit\Plugin\Payment\TypeCode
function testCreate() {
$container = $this
->createMock(ContainerInterface::class);
$map = array(
array(
'entity_field.manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->entityFieldManager,
),
array(
'payment.event_dispatcher',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->eventDispatcher,
),
array(
'string_translation',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->stringTranslation,
),
array(
'url_generator',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->urlGenerator,
),
);
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$configuration = [];
$plugin_definition = [];
$plugin_id = $this
->randomMachineName();
$sut = PaymentReference::create($container, $configuration, $plugin_id, $plugin_definition);
$this
->assertInstanceOf(PaymentReference::class, $sut);
}