You are here

public function ConfigOperationsProviderTest::testGetOperations in Payment 8.2

@covers ::getOperations

File

tests/src/Unit/Plugin/Payment/Status/ConfigOperationsProviderTest.php, line 79

Class

ConfigOperationsProviderTest
@coversDefaultClass \Drupal\payment\Plugin\Payment\Status\ConfigOperationsProvider

Namespace

Drupal\Tests\payment\Unit\Plugin\Payment\Status

Code

public function testGetOperations() {
  $entity_id = $this
    ->randomMachineName();
  $plugin_id = 'payment_config:' . $entity_id;
  $payment_status = $this
    ->createMock(PaymentStatusInterface::class);
  $this->paymentStatusStorage
    ->expects($this
    ->once())
    ->method('load')
    ->with($entity_id)
    ->willReturn($payment_status);
  $operations = array(
    'foo' => array(
      'title' => $this
        ->randomMachineName(),
    ),
  );
  $this->paymentStatusListBuilder
    ->expects($this
    ->once())
    ->method('getOperations')
    ->with($payment_status)
    ->willReturn($operations);
  $this
    ->assertSame($operations, $this->sut
    ->getOperations($plugin_id));
}