You are here

public function EntityUsageTest::usageBulkTargetDeleteEventRecorder in Entity Usage 8.2

Same name and namespace in other branches
  1. 8.4 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::usageBulkTargetDeleteEventRecorder()
  2. 8 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::usageBulkTargetDeleteEventRecorder()
  3. 8.3 tests/src/Kernel/EntityUsageTest.php \Drupal\Tests\entity_usage\Kernel\EntityUsageTest::usageBulkTargetDeleteEventRecorder()

Reacts to bulk target delete event.

Parameters

\Drupal\entity_usage\Events\EntityUsageEvent $event: The entity usage event.

string $name: The name of the event.

File

tests/src/Kernel/EntityUsageTest.php, line 856

Class

EntityUsageTest
Tests the basic API operations of our tracking service.

Namespace

Drupal\Tests\entity_usage\Kernel

Code

public function usageBulkTargetDeleteEventRecorder(EntityUsageEvent $event, $name) {
  $this->state
    ->set('entity_usage_events_test.usage_bulk_delete_targets', [
    'event_name' => $name,
    'target_id' => $event
      ->getTargetEntityId(),
    'target_type' => $event
      ->getTargetEntityType(),
    'source_id' => $event
      ->getSourceEntityId(),
    'source_type' => $event
      ->getSourceEntityType(),
    'source_langcode' => $event
      ->getSourceEntityLangcode(),
    'source_vid' => $event
      ->getSourceEntityRevisionId(),
    'method' => $event
      ->getMethod(),
    'field_name' => $event
      ->getFieldName(),
    'count' => $event
      ->getCount(),
  ]);
}