You are here

public function ImportEntityManagerTest::testEntityPresaveNodeIsPendingSync in Acquia Content Hub 8

Tests the entityPresave() method, node is pending sync.

@covers ::entityPresave

File

tests/src/Unit/ImportEntityManagerTest.php, line 319

Class

ImportEntityManagerTest
PHPUnit test for the ImportEntityManager class.

Namespace

Drupal\Tests\acquia_contenthub\Unit

Code

public function testEntityPresaveNodeIsPendingSync() {
  $original_node = $this
    ->createMock('\\Drupal\\node\\NodeInterface');
  $node = $this
    ->createMock('\\Drupal\\node\\NodeInterface');
  $node->original = $original_node;
  $node
    ->expects($this
    ->once())
    ->method('getEntityTypeId')
    ->willReturn('node');
  $node
    ->expects($this
    ->once())
    ->method('id')
    ->willReturn(12);
  $this->contentHubEntitiesTracking
    ->expects($this
    ->once())
    ->method('loadImportedByDrupalEntity')
    ->with('node', 12)
    ->willReturn($this->contentHubEntitiesTracking);
  $this->contentHubEntitiesTracking
    ->expects($this
    ->once())
    ->method('isPendingSync')
    ->willReturn(TRUE);
  $this->diffEntityComparison
    ->expects($this
    ->never())
    ->method('compareRevisions');
  $this->importEntityManager
    ->entityPresave($node);
}