You are here

public function PaymentStatusLabelTest::testRender in Payment 8.2

@covers ::render

File

tests/src/Unit/Plugin/views/field/PaymentStatusLabelTest.php, line 79

Class

PaymentStatusLabelTest
@coversDefaultClass \Drupal\payment\Plugin\views\field\PaymentStatusLabel

Namespace

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

Code

public function testRender() {
  $plugin_id = $this
    ->randomMachineName();
  $plugin_label = $this
    ->randomMachineName();
  $plugin_definition = [
    'label' => $plugin_label,
  ];
  $this->paymentStatusManager
    ->expects($this
    ->atLeastOnce())
    ->method('getDefinition')
    ->with($plugin_id)
    ->willReturn($plugin_definition);
  $result_row = new ResultRow();
  $result_row->{$this->sut->field_alias} = $plugin_id;
  $this
    ->assertSame($plugin_label, $this->sut
    ->render($result_row));
}