You are here

public function EventDispatcherCollectionTest::testPreRefundPayment in Payment 8.2

@covers ::preRefundPayment

File

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

Class

EventDispatcherCollectionTest
@coversDefaultClass \Drupal\payment\EventDispatcherCollection

Namespace

Drupal\Tests\payment\Unit

Code

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