Yoast / yoast-acf-analysis

WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
GNU General Public License v3.0
61 stars 20 forks source link

QA: use the most specific PHPUnit assertion possible #200

Closed jrfnl closed 5 years ago

jrfnl commented 5 years ago

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() to assertSame(), where assertEquals() does a loose type comparison and assertSame() 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:

IreneStr commented 5 years ago

CR 👍