givewp icon indicating copy to clipboard operation
givewp copied to clipboard

Refactor: Remove side effects from data provider

Open pulsovi opened this issue 6 months ago • 2 comments

Issue

Tests_MISC_Functions->test_give_meta_helpers's data provider had side effects, which caused unexpected failures when using the --filter option of PHPUnit.

Solution

  • Removal of data provider side effects

Impact

This change improves test reliability and isolation, allowing more predictable execution, especially when using --filter.

Good practice

Data providers should never have side effects to guarantee the consistency and independence of the tests.

pulsovi avatar Aug 05 '24 19:08 pulsovi