ProcessEntitiesTest is allowing unexpected results to slip through

Created on 20 November 2024, 5 months ago

Problem/Motivation

While working on πŸ› Encrypted decimal field value not saved on drupal version 10.2.x+ Active I noticed an issue with ProcessEntitiesTest. Given the bug outlined in πŸ› Encrypted decimal field value not saved on drupal version 10.2.x+ Active , one would expect changing encrypted_decimal to 'type' => 'decimal' in ProcessEntitiesTest::encryptDecryptEntityDataProvider would cause ProcessEntitiesTest::testEncryptDecryptEntity to correctly fail due to ProcessEntities::getUnencryptedPlaceholderValue returning NULL for this field instead of 0. It didn't.

In debugging the code I found that the setValue call in ProcessEntitiesTest was correctly returning NULL but MockObject::expects was allowing 0 to pass.

Steps to reproduce

  1. Configure a Drupal Site version 10.2+, with Field Encrypt version 3.2.0 installed and PHPUnit testing configured.
  2. Change encrypted_decimal DataDefinition to 'type' => 'decimal' in ProcessEntitiesTest::encryptDecryptEntityDataProvider
  3. Run ProcessEntitiesTest tests

Proposed resolution

TBD

Remaining tasks

TBD

πŸ› Bug report
Status

Needs work

Version

3.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada tame4tex

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024