ConfigEntityNormalizerTest.php in Zircon Profile 8.0
File
core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
View source
<?php
namespace Drupal\Tests\serialization\Unit\Normalizer;
use Drupal\serialization\Normalizer\ConfigEntityNormalizer;
use Drupal\Tests\UnitTestCase;
class ConfigEntityNormalizerTest extends UnitTestCase {
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));
}
}