Problem/Motivation

Since the commit of #2923567: Select from correct entity tables for additional entity/field definitions when moving data to dedicated table storage from shared table storage for the purposes of purging, EntityDefinitionUpdateTest fails with contrib db driver.

1) Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testBaseFieldDeleteWithExistingData with data set "Revisionable entity type, non revisionable base field" ('entity_test_mulrev', true, false)

Failed asserting that Array &0 (

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'bundle' => 'entity_test_mulrev'

    'new_base_field_value' => 'bar'

) is identical to Array &0 (

    'bundle' => 'entity_test_mulrev'

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'new_base_field_value' => 'bar'

).


/home/travis/drupal8/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php:476


2) Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testBaseFieldDeleteWithExistingData with data set "Revisionable entity type, revisionable base field" ('entity_test_mulrev', true, true)

Failed asserting that Array &0 (

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'bundle' => 'entity_test_mulrev'

    'new_base_field_value' => 'bar'

) is identical to Array &0 (

    'bundle' => 'entity_test_mulrev'

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'new_base_field_value' => 'bar'

).


/home/travis/drupal8/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php:476


3) Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testBaseFieldDeleteWithExistingData with data set "Non-translatable revisionable entity type, revisionable base field" ('entity_test_rev', true, true)

Failed asserting that Array &0 (

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'bundle' => 'entity_test_rev'

    'new_base_field_value' => 'bar'

) is identical to Array &0 (

    'bundle' => 'entity_test_rev'

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'new_base_field_value' => 'bar'

).


/home/travis/drupal8/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php:476


4) Drupal\KernelTests\Core\Entity\EntityDefinitionUpdateTest::testBaseFieldDeleteWithExistingData with data set "Non-translatable revisionable entity type, non-revisionable base field" ('entity_test_rev', true, false)

Failed asserting that Array &0 (

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'bundle' => 'entity_test_rev'

    'new_base_field_value' => 'bar'

) is identical to Array &0 (

    'bundle' => 'entity_test_rev'

    'deleted' => '1'

    'entity_id' => '2'

    'revision_id' => '3'

    'langcode' => 'en'

    'delta' => '0'

    'new_base_field_value' => 'bar'

).


/home/travis/drupal8/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php:476

This is because the test checks for the identicality of an expected array to the actual results. The assert relies on the fact that not only array values are the same, but also about the sequence of the keys in the array.

Proposed resolution

Use assertEquals instead of assertSame

Remaining tasks

review

User interface changes

na

API changes

na

Data model changes

na

CommentFileSizeAuthor
#2 2930197-2.patch1.4 KBmondrake
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
FileSize
1.4 KB
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Oops.. :)

plach’s picture

Just out of curiosity: which DB driver are we talking about?

mondrake’s picture

plach’s picture

Ciao :)

Very interesting stuff, thanks! I will commit this ASAP.

  • plach committed 8c44f20 on 8.5.x
    Issue #2930197 by mondrake, amateescu: EntityDefinitionUpdateTest fails...
plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8c44f20 and pushed to 8.5.x. Thanks!

Status: Fixed » Closed (fixed)

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