You are here

public function EntityFormTest::testGetFormNodeNoId in Acquia Content Hub 8

Tests the getForm() method, node has no id.

@covers ::getForm

File

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

Class

EntityFormTest
PHPUnit test for the EntityForm class.

Namespace

Drupal\Tests\acquia_contenthub\Unit\Form

Code

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