You are here

protected function ContentEntityNormalizerTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\ContentEntityNormalizerTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php, line 43
Contains \Drupal\Tests\serialization\Unit\Normalizer\ContentEntityNormalizerTest.

Class

ContentEntityNormalizerTest
@coversDefaultClass \Drupal\serialization\Normalizer\ContentEntityNormalizer @group serialization

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

protected function setUp() {
  $this->entityManager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $this->contentEntityNormalizer = new ContentEntityNormalizer($this->entityManager);
  $this->serializer = $this
    ->getMockBuilder('Symfony\\Component\\Serializer\\Serializer')
    ->disableOriginalConstructor()
    ->setMethods(array(
    'normalize',
  ))
    ->getMock();
  $this->contentEntityNormalizer
    ->setSerializer($this->serializer);
}