function ListPaymentTypesTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Controller/ ListPaymentTypesTest.php, line 75
Class
- ListPaymentTypesTest
- @coversDefaultClass \Drupal\payment\Controller\ListPaymentTypes
Namespace
Drupal\Tests\payment\Unit\ControllerCode
function testCreate() {
$container = $this
->createMock(ContainerInterface::class);
$map = [
[
'current_user',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->currentUser,
],
[
'module_handler',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->moduleHandler,
],
[
'plugin.manager.payment.type',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->paymentTypeManager,
],
[
'string_translation',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->stringTranslation,
],
];
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = ListPaymentTypes::create($container);
$this
->assertInstanceOf(ListPaymentTypes::class, $sut);
}