function AddPaymentStatusTest::testCreate in Payment 8.2
@covers ::create @covers ::__construct
File
- tests/
src/ Unit/ Controller/ AddPaymentStatusTest.php, line 57
Class
- AddPaymentStatusTest
- @coversDefaultClass \Drupal\payment\Controller\AddPaymentStatus
Namespace
Drupal\Tests\payment\Unit\ControllerCode
function testCreate() {
$entity_type_manager = $this
->createMock(EntityTypeManagerInterface::class);
$entity_type_manager
->expects($this
->once())
->method('getStorage')
->with('payment_status')
->willReturn($this->paymentStatusStorage);
$container = $this
->createMock(ContainerInterface::class);
$map = [
[
'entity.form_builder',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->entityFormBuilder,
],
[
'entity_type.manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$entity_type_manager,
],
];
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = AddPaymentStatus::create($container);
$this
->assertInstanceOf(AddPaymentStatus::class, $sut);
}