You are here

public function ConfigEntityNormalizerTest::testNormalize in Zircon Profile 8

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

Tests the normalize() method.

@covers ::normalize

File

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

Class

ConfigEntityNormalizerTest
@coversDefaultClass \Drupal\serialization\Normalizer\ConfigEntityNormalizer @group serialization

Namespace

Drupal\Tests\serialization\Unit\Normalizer

Code

public function testNormalize() {
  $test_export_properties = array(
    'test' => 'test',
  );
  $entity_manager = $this
    ->getMock('Drupal\\Core\\Entity\\EntityManagerInterface');
  $normalizer = new ConfigEntityNormalizer($entity_manager);
  $config_entity = $this
    ->getMock('Drupal\\Core\\Config\\Entity\\ConfigEntityInterface');
  $config_entity
    ->expects($this
    ->once())
    ->method('toArray')
    ->will($this
    ->returnValue($test_export_properties));
  $this
    ->assertSame($test_export_properties, $normalizer
    ->normalize($config_entity));
}