You are here

public function EventDispatcherCollectionTest::testPreCapturePayment in Payment 8.2

@covers ::preCapturePayment

File

tests/src/Unit/EventDispatcherCollectionTest.php, line 183

Class

EventDispatcherCollectionTest
@coversDefaultClass \Drupal\payment\EventDispatcherCollection

Namespace

Drupal\Tests\payment\Unit

Code

public function testPreCapturePayment() {
  $payment = $this
    ->createMock(PaymentInterface::class);
  $event_dispatcher_a = $this
    ->createMock(EventDispatcherInterface::class);
  $event_dispatcher_a
    ->expects($this
    ->atLeastOnce())
    ->method('preCapturePayment')
    ->with($payment);
  $event_dispatcher_b = $this
    ->createMock(EventDispatcherInterface::class);
  $event_dispatcher_b
    ->expects($this
    ->atLeastOnce())
    ->method('preCapturePayment')
    ->with($payment);
  $this->sut
    ->addEventDispatcher($event_dispatcher_a);
  $this->sut
    ->addEventDispatcher($event_dispatcher_b);
  $this->sut
    ->preCapturePayment($payment);
}