This PR can be summarized in the following changelog entry:
N/A
Relevant technical choices:
This is a long established best practice.
PHPUnit contains a variety of assertions and the ones available have been extended hugely over the years.
To have the most reliable tests, the most specific assertion should be used.
This implements this for the Yoast ACF Analysis plugin.
Most notably, this changes calls to assertEquals() to assertSame(), where assertEquals() does a loose type comparison and assertSame() does a strict type comparison.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
This is a long established best practice.
PHPUnit contains a variety of assertions and the ones available have been extended hugely over the years. To have the most reliable tests, the most specific assertion should be used.
This implements this for the Yoast ACF Analysis plugin.
Refs:
Most notably, this changes calls to
assertEquals()
toassertSame()
, whereassertEquals()
does a loose type comparison andassertSame()
does a strict type comparison.Refs:
It also includes a stricter check on arrays which are supposed to be empty and removes a duplicate function call.
Test instructions
This PR can be tested by following these steps: