You are here

public function UnserializationTest::testConfigEntityUnserialization in Acquia Content Hub 8.2

Tests configuration entity unserialization.

Throws

\Drupal\Core\Entity\EntityStorageException

\ReflectionException

File

tests/src/Kernel/UnserializationTest.php, line 144

Class

UnserializationTest
Tests that entities are properly unserialized.

Namespace

Drupal\Tests\acquia_contenthub\Kernel

Code

public function testConfigEntityUnserialization() {
  $cdf_document = $this
    ->createCDFDocumentFromFixture('view_modes.json');
  $this->contentHubClient
    ->getEntities([
    self::CLIENT_UUID_1 => self::CLIENT_UUID_1,
  ])
    ->willReturn($cdf_document);
  $this->contentHubClient
    ->getInterestsByWebhook(Argument::type('string'))
    ->willReturn([
    self::CLIENT_UUID_1,
  ]);
  $this
    ->initializeContentHubClientExpectation($cdf_document);
  $this->contentHubClient
    ->addEntitiesToInterestList("foo", [
    self::CLIENT_UUID_1,
  ])
    ->willReturn(new Response());
  $item = new \stdClass();
  $item->uuids = implode(', ', [
    self::CLIENT_UUID_1,
  ]);
  $this->contentHubImportQueueWorker
    ->processItem($item);
  $view_mode = EntityViewMode::load('node.teaser');
  $this
    ->assertNotEmpty($view_mode
    ->id());
}