You are here

function SetStatusTest::testCreate in Payment 8.2

@covers ::create @covers ::__construct

File

tests/src/Unit/Plugin/Action/SetStatusTest.php, line 84

Class

SetStatusTest
@coversDefaultClass \Drupal\payment\Plugin\Action\SetStatus

Namespace

Drupal\Tests\payment\Unit\Plugin\Action

Code

function testCreate() {
  $plugin_type_manager = $this
    ->prophesize(PluginTypeManagerInterface::class);
  $plugin_type_manager
    ->getPluginType('payment_status')
    ->willReturn($this->paymentStatusType
    ->reveal());
  $container = $this
    ->createMock(ContainerInterface::class);
  $map = array(
    array(
      'plugin.manager.plugin.plugin_selector',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->pluginSelectorManager,
    ),
    array(
      'plugin.plugin_type_manager',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $plugin_type_manager
        ->reveal(),
    ),
    array(
      'string_translation',
      ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
      $this->stringTranslation,
    ),
  );
  $container
    ->expects($this
    ->any())
    ->method('get')
    ->willReturnMap($map);
  $configuration = [];
  $plugin_definition = [];
  $plugin_id = $this
    ->randomMachineName();
  $sut = SetStatus::create($container, $configuration, $plugin_id, $plugin_definition);
  $this
    ->assertInstanceOf(SetStatus::class, $sut);
}