You are here

public function EventDispatcherCollectionTest::testSetPaymentStatus in Payment 8.2

@covers ::setPaymentStatus

File

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

Class

EventDispatcherCollectionTest
@coversDefaultClass \Drupal\payment\EventDispatcherCollection

Namespace

Drupal\Tests\payment\Unit

Code

public function testSetPaymentStatus() {
  $payment = $this
    ->createMock(PaymentInterface::class);
  $previous_payment_status = $this
    ->createMock(PaymentStatusInterface::class);
  $event_dispatcher_a = $this
    ->createMock(EventDispatcherInterface::class);
  $event_dispatcher_a
    ->expects($this
    ->atLeastOnce())
    ->method('setPaymentStatus')
    ->with($payment, $previous_payment_status);
  $event_dispatcher_b = $this
    ->createMock(EventDispatcherInterface::class);
  $event_dispatcher_b
    ->expects($this
    ->atLeastOnce())
    ->method('setPaymentStatus')
    ->with($payment, $previous_payment_status);
  $this->sut
    ->addEventDispatcher($event_dispatcher_a);
  $this->sut
    ->addEventDispatcher($event_dispatcher_b);
  $this->sut
    ->setPaymentStatus($payment, $previous_payment_status);
}