You are here

protected function PurgeTest::setUp in Acquia Content Hub 8.2

Overrides EntityKernelTestBase::setUp

File

tests/src/Kernel/EventSubscriber/HandleWebhook/PurgeTest.php, line 77

Class

PurgeTest
Tests queue and export table purge.

Namespace

Drupal\Tests\acquia_contenthub\Kernel\EventSubscriber\HandleWebhook

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installSchema('acquia_contenthub_publisher', [
    'acquia_contenthub_publisher_export_tracking',
  ]);
  $this->configFactory = $this->container
    ->get('config.factory');
  $this
    ->createAcquiaContentHubAdminSettings();
  $this->clientFactory = $this->container
    ->get('acquia_contenthub.client.factory');

  // Create a test node.
  Node::create([
    'type' => 'article',
    'title' => 'Test EN',
  ])
    ->save();
  $this->queueFactory = $this->container
    ->get('queue');
  $this->database = $this->container
    ->get('database');
  $this->loggerChannel = $this
    ->prophesize(LoggerChannelInterface::class)
    ->reveal();
  $this->purge = new Purge($this->queueFactory, $this->loggerChannel, $this->database);
}