You are here

public function EntityFormTest::testGetFormNodeNotImported in Acquia Content Hub 8

Tests the getForm() method, node is not imported.

@covers ::getForm

File

tests/src/Unit/Form/EntityFormTest.php, line 76

Class

EntityFormTest
PHPUnit test for the EntityForm class.

Namespace

Drupal\Tests\acquia_contenthub\Unit\Form

Code

public function testGetFormNodeNotImported() {
  $node = $this
    ->createMock('\\Drupal\\node\\NodeInterface');
  $node
    ->expects($this
    ->once())
    ->method('id')
    ->willReturn(12);
  $node
    ->expects($this
    ->once())
    ->method('getEntityTypeId')
    ->willReturn('node');
  $this->contentHubEntitiesTracking
    ->expects($this
    ->once())
    ->method('loadImportedByDrupalEntity')
    ->with('node', 12)
    ->willReturn(NULL);
  $this->contentHubEntitiesTracking
    ->expects($this
    ->never())
    ->method('hasLocalChange');
  $form = $this->entityForm
    ->getForm($node);
  $this
    ->assertNull($form);
}