public function PaymentLineItemLabelTest::testRender in Payment 8.2
@covers ::render
File
- tests/
src/ Unit/ Plugin/ views/ field/ PaymentLineItemLabelTest.php, line 79
Class
- PaymentLineItemLabelTest
- @coversDefaultClass \Drupal\payment\Plugin\views\field\PaymentLineItemLabel
Namespace
Drupal\Tests\payment\Unit\Plugin\views\fieldCode
public function testRender() {
$plugin_id = $this
->randomMachineName();
$plugin_label = $this
->randomMachineName();
$plugin_definition = [
'label' => $plugin_label,
];
$this->paymentLineItemManager
->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));
}