You are here

public function PaymentReferenceConfigurationFormTest::setUp in Payment 8.2

Overrides UnitTestCase::setUp

File

modules/payment_reference/tests/src/Unit/Plugin/Payment/Type/PaymentReferenceConfigurationFormTest.php, line 98

Class

PaymentReferenceConfigurationFormTest
@coversDefaultClass \Drupal\payment_reference\Plugin\Payment\Type\PaymentReferenceConfigurationForm

Namespace

Drupal\Tests\payment_reference\Unit\Plugin\Payment\Type

Code

public function setUp() : void {
  $this->configFactoryConfiguration = array(
    'payment_reference.payment_type' => array(
      'limit_allowed_plugins' => TRUE,
      'allowed_plugin_ids' => array(
        $this
          ->randomMachineName(),
      ),
      'plugin_selector_id' => $this
        ->randomMachineName(),
    ),
  );
  $this->configFactory = $this
    ->getConfigFactoryStub($this->configFactoryConfiguration);
  $this->paymentMethodManager = $this
    ->createMock(PaymentMethodManagerInterface::class);
  $this->pluginSelector = $this
    ->createMock(PluginSelectorInterface::class);
  $this->pluginSelectorManager = $this
    ->createMock(PluginSelectorManagerInterface::class);
  $this->stringTranslation = $this
    ->getStringTranslationStub();
  $this->pluginSelectorType = $this
    ->prophesize(PluginTypeInterface::class);
  $this->pluginSelectorType
    ->getPluginManager()
    ->willReturn($this->pluginSelectorManager);
  $this->selectedPluginSelector = $this
    ->createMock(PluginSelectorInterface::class);
  $this->messenger = $this
    ->createMock(MessengerInterface::class);
  $this->sut = new PaymentReferenceConfigurationForm($this->configFactory, $this->stringTranslation, $this->paymentMethodManager, $this->pluginSelectorType
    ->reveal());
  $this->sut
    ->setMessenger($this->messenger);
}