This will be the first of a few, we have integration tests for serializer classes, but no actual unit tests yet. There should be a lot of stuff we can test. So let's start with the Drupal\serialization\Normalizer\TypedDataNormalizer class.

Files: 
CommentFileSizeAuthor
#2 2082735-2.patch2.16 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 58,837 pass(es).
[ View ]
#2 interdiff-2082735-2.txt1.29 KBdamiankloip
d8.TypedDataNormalizerTest.patch1.94 KBdamiankloip
PASSED: [[SimpleTest]]: [MySQL] 58,671 pass(es).
[ View ]

Comments

  1. +++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/TypedDataNormalizerTest.php
    @@ -0,0 +1,65 @@
    +/**
    + * Tests the TypedDataNormalizer class.
    + *
    + * @see \Drupal\serialization\Normalizer\TypedDataNormalizer
    + */
    +class TypedDataNormalizerTest extends UnitTestCase {

    It would be cool to have a @group Drupal at least.

  2. +++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/TypedDataNormalizerTest.php
    @@ -0,0 +1,65 @@
    +
    +  /**
    +   * Tests the supportsNormalization() method.
    +   */
    +  public function testSupportsNormalization() {
    +    $this->assertTrue($this->normalizer->supportsNormalization($this->typedData));
    +  }

    What about passing in some non typed data data?

StatusFileSize
new1.29 KB
new2.16 KB
PASSED: [[SimpleTest]]: [MySQL] 58,837 pass(es).
[ View ]

Great, thanks for the review! Here are those changes.

Status:Needs review» Reviewed & tested by the community

Thank you!

Status:Reviewed & tested by the community» Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.