You are here

public function ContentEntityNormalizerAlterTest::testNormalizerAlterEvent in Replication 8.2

Tests the content entity normalize alter event.

File

tests/src/Unit/Normalizer/ContentEntityNormalizerAlterTest.php, line 61

Class

ContentEntityNormalizerAlterTest
Tests the content serialization format.

Namespace

Drupal\Tests\replication\Unit\Normalizer

Code

public function testNormalizerAlterEvent() {
  $normalized = $this->serializer
    ->normalize($this->entity);

  // The '_test' key should be added in
  // \Drupal\replication_alter_test\Event\ContentEntityTestAlterSubscriber::onAlterContentData
  $this
    ->assertSame([
    'foo' => 'bar',
  ], $normalized['_test']);
}