Version 1
[yaffs-website] / web / core / modules / serialization / tests / src / Unit / Normalizer / ConfigEntityNormalizerTest.php
diff --git a/web/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php b/web/core/modules/serialization/tests/src/Unit/Normalizer/ConfigEntityNormalizerTest.php
new file mode 100644 (file)
index 0000000..371450a
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+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 = ['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));
+  }
+
+}