You are here

public function PublisherTrackerTest::testNullifyHashes in Acquia Content Hub 8.2

Test case to nullifies hashes.

@covers ::nullifyHashes

Throws

\Drupal\Core\Entity\EntityStorageException

\Exception

File

tests/src/Kernel/PublisherTrackerTest.php, line 62

Class

PublisherTrackerTest
Tests publisher tracker methods.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

public function testNullifyHashes() : void {
  while ($item = $this->queue
    ->claimItem()) {
    $this->queueWorker
      ->processItem($item->data);
  }
  $hash_before = $this
    ->getTrackingTableColByUuid($this->node
    ->uuid(), 'hash');
  $this
    ->assertNotEmpty($hash_before);
  $status = $this
    ->getTrackingTableColByUuid($this->node
    ->uuid(), 'status');

  // Nullifies hashes in the Publisher Tracker.
  $this->publisherTracker
    ->nullifyHashes([
    $status,
  ], [
    'node',
  ], [
    $this->node
      ->uuid(),
  ]);
  $hash_after = $this
    ->getTrackingTableColByUuid($this->node
    ->uuid(), 'hash');
  $this
    ->assertEmpty($hash_after);
}