You are here

ConfigEntityNormalizerTest.php in Zircon Profile 8

File

core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\Tests\serialization\Unit\Normalizer\ConfigEntityNormalizerTest.
 */
namespace Drupal\Tests\serialization\Unit\Normalizer;

use Drupal\serialization\Normalizer\ConfigEntityNormalizer;
use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\serialization\Normalizer\ConfigEntityNormalizer
 * @group serialization
 */
class ConfigEntityNormalizerTest extends UnitTestCase {

  /**
   * Tests the normalize() method.
   *
   * @covers ::normalize
   */
  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));
  }

}

Classes

Namesort descending Description
ConfigEntityNormalizerTest @coversDefaultClass \Drupal\serialization\Normalizer\ConfigEntityNormalizer @group serialization