You are here

public function CaptchaPointListBuilderTest::testBuildRow in CAPTCHA 8

Test for buildRow.

File

tests/src/Unit/Controller/CaptchaPointListBuilderTest.php, line 53

Class

CaptchaPointListBuilderTest
Tests for CaptchaPointListBuilder.

Namespace

Drupal\Tests\captcha\Unit\Controller

Code

public function testBuildRow() {
  $mockEntity = $this
    ->prophesize(CaptchaPoint::class);
  $mockEntity
    ->access(Argument::any())
    ->willReturn(FALSE);
  $mockEntity
    ->id()
    ->willReturn('target_form_id');
  $mockEntity
    ->getCaptchaType()
    ->willReturn('captcha_type');
  $row = $this->listBuilder
    ->buildRow($mockEntity
    ->reveal());
  $this
    ->assertArrayHasKey('form_id', $row);
  $this
    ->assertEquals('target_form_id', $row['form_id']);
  $this
    ->assertArrayHasKey('captcha_type', $row);
  $this
    ->assertEquals('captcha_type', $row['captcha_type']);
}