You are here

public function ContentHubEntityEmbedHandlerTest::testIsProcessable in Acquia Content Hub 8

Test for isProcessable method.

@covers ::isProcessable

File

tests/src/Unit/ContentHubEntityEmbedHandlerTest.php, line 114

Class

ContentHubEntityEmbedHandlerTest
PHPUnit for the ContentHubEntityEmbedHandler class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testIsProcessable() {
  $field_definition = $this
    ->createMock('\\Drupal\\Core\\Field\\FieldDefinitionInterface');
  $field_definition
    ->expects($this
    ->at(0))
    ->method('getType')
    ->willReturn('text_with_summary');
  $field_definition
    ->expects($this
    ->at(1))
    ->method('getType')
    ->willReturn('string_long');
  $field_definition
    ->expects($this
    ->at(2))
    ->method('getType')
    ->willReturn('text_long');
  $field_definition
    ->expects($this
    ->at(3))
    ->method('getType')
    ->willReturn('text');
  $this->field
    ->expects($this
    ->any())
    ->method('getFieldDefinition')
    ->willReturn($field_definition);
  $this
    ->assertTrue($this->entityEmbedHandler
    ->isProcessable());
  $this
    ->assertTrue($this->entityEmbedHandler
    ->isProcessable());
  $this
    ->assertTrue($this->entityEmbedHandler
    ->isProcessable());
  $this
    ->assertFalse($this->entityEmbedHandler
    ->isProcessable());
}