You are here

public function AgreementEntityTest::testPreRender in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/Unit/Plugin/views/field/AgreementEntityTest.php \Drupal\Tests\agreement\Unit\Plugin\views\field\AgreementEntityTest::testPreRender()

Asserts agreement entity set on results.

File

tests/src/Unit/Plugin/views/field/AgreementEntityTest.php, line 84

Class

AgreementEntityTest
Tests the agreement entity views field plugin.

Namespace

Drupal\Tests\agreement\Unit\Plugin\views\field

Code

public function testPreRender() {
  $values = [
    new ResultRow([
      'type' => 'default',
      'uid' => 1,
    ]),
    new ResultRow([
      'type' => 'default',
      'uid' => 2,
    ]),
    new ResultRow([
      'uid' => 3,
    ]),
  ];
  $this->plugin
    ->preRender($values);
  $this
    ->assertObjectHasAttribute('_agreement', $values[0]);
}