You are here

public function IsExcludedImageStyleTest::testOnEnqueueCandidateEntity in Acquia Lift Connector 8.4

Tests entity eligibility.

@dataProvider onEnqueueCandidateEntityDataProvider

Parameters

string $operation: Entity operation.

string $index: Item's index in registry.

bool $expected: Expected result.

File

modules/acquia_lift_publisher/tests/src/Kernel/EventSubscriber/EnqueueEligibility/IsExcludedImageStyleTest.php, line 105

Class

IsExcludedImageStyleTest
Class IsExcludedImageStyleTest.

Namespace

Drupal\Tests\acquia_lift_publisher\Kernel\EventSubscriber\EnqueueEligibility

Code

public function testOnEnqueueCandidateEntity(string $operation, string $index, bool $expected) {
  if (empty(self::$registry[$index])) {
    $this
      ->markTestIncomplete(sprintf('Specified item %s not found in registry', $index));
  }
  $entity = self::$registry[$index];
  $event = new ContentHubEntityEligibilityEvent($entity, $operation);
  $this->eventDispatcher
    ->dispatch(ContentHubPublisherEvents::ENQUEUE_CANDIDATE_ENTITY, $event);
  $message = sprintf('Entity with index %s has wrong expected eligibility', $index);
  $this
    ->assertEquals($event
    ->getEligibility(), $expected, $message);
}