You are here

public function PaymentMethodLabelTest::setUp in Payment 8.2

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/views/field/PaymentMethodLabelTest.php, line 37

Class

PaymentMethodLabelTest
@coversDefaultClass \Drupal\payment\Plugin\views\field\PaymentMethodLabel

Namespace

Drupal\Tests\payment\Unit\Plugin\views\field

Code

public function setUp() : void {
  $this->paymentMethodManager = $this
    ->createMock(PaymentMethodManagerInterface::class);
  $configuration = [];
  $plugin_id = $this
    ->randomMachineName();
  $plugin_definition = [];
  $this->sut = new PaymentMethodLabel($configuration, $plugin_id, $plugin_definition, $this->paymentMethodManager);
  $options = [
    'relationship' => 'none',
  ];
  $view_executable = $this
    ->getMockBuilder(ViewExecutable::class)
    ->disableOriginalConstructor()
    ->getMock();
  $display = $this
    ->getMockBuilder(DisplayPluginBase::class)
    ->disableOriginalConstructor()
    ->getMockForAbstractClass();
  $this->sut
    ->init($view_executable, $display, $options);
}