public function ImportEntityManagerTest::testEntityUpdateNodeToResync in Acquia Content Hub 8
Tests the entityUpdate() method, node is to be resync'ed.
@covers ::entityUpdate
File
- tests/
src/ Unit/ ImportEntityManagerTest.php, line 190
Class
- ImportEntityManagerTest
- PHPUnit test for the ImportEntityManager class.
Namespace
Drupal\Tests\acquia_contenthub\UnitCode
public function testEntityUpdateNodeToResync() {
$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($this->contentHubEntitiesTracking);
$this->contentHubEntitiesTracking
->expects($this
->once())
->method('isPendingSync')
->willReturn(TRUE);
$uuid = '75156e0c-9b3c-48f0-b385-a373d98f8ba7';
$this->contentHubEntitiesTracking
->expects($this
->once())
->method('getUuid')
->willReturn($uuid);
$this->clientManager
->expects($this
->once())
->method('createRequest')
->with('readEntity', [
$uuid,
]);
$this->importEntityManager
->entityUpdate($node);
}