Why? Because we only have web tests for this class, and we have PHPUnit tested most of the other classes now. This is one of the remaining stragglers.

Comments

Status: Needs review » Needs work

The last submitted patch, D8.serialization.EntityNormalizerTest.patch, failed testing.

The last submitted patch, D8.serialization.EntityNormalizerTest.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
dawehner’s picture

  1. +++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php
    @@ -0,0 +1,187 @@
    +/**
    + * Tests the EntityNormalizer class.
    + */
    +class EntityNormalizerTest extends UnitTestCase {
    ...
    +  /**
    +   * Tests the normalize() method.
    +   */
    +  public function testNormalize() {
    ...
    +  /**
    +   * Tests the denormalize method with a bundle property.
    +   */
    +  public function testDenormalizeWithBundle() {
    ...
    +  /**
    +   * Tests the denormalize method with no bundle defined.
    +   */
    +  public function testDenormalizeWithNoBundle() {
    

    It would be great to use @coversDefaultClass and @covers

  2. +++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/EntityNormalizerTest.php
    @@ -0,0 +1,187 @@
    +
    +    $content_entity = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityBase')
    +      ->disableOriginalConstructor()
    +      ->setMethods(array('getProperties'))
    +      ->getMockForAbstractClass();
    

    I try to figure out why we cannot simply mock the ContentEntityInterface here? Oh right this bullshit transverable thing.

damiankloip’s picture

StatusFileSize
new6.27 KB
new1.68 KB

I try to figure out why we cannot simply mock the ContentEntityInterface here? Oh right this bullshit transverable thing.

Yep, it's that crap!

Status: Needs review » Needs work

The last submitted patch, 5: 2191897-3.patch, failed testing.

damiankloip’s picture

5: 2191897-3.patch queued for re-testing.

The last submitted patch, 5: 2191897-3.patch, failed testing.

damiankloip’s picture

5: 2191897-3.patch queued for re-testing.

The last submitted patch, 5: 2191897-3.patch, failed testing.

damiankloip’s picture

5: 2191897-3.patch queued for re-testing.

damiankloip’s picture

Status: Needs work » Needs review
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8f546e5 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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