Skip to content

Issue-864: Resolve PHP Deprecations#866

Merged
mogmarsh merged 18 commits intomainfrom
fix/issue-864/resolve-php-deprecations-in-tests
Mar 21, 2024
Merged

Issue-864: Resolve PHP Deprecations#866
mogmarsh merged 18 commits intomainfrom
fix/issue-864/resolve-php-deprecations-in-tests

Conversation

@anubisthejackle
Copy link
Copy Markdown
Contributor

Description

While running the unit tests, I run into several PHP deprecations. It'd be great if those issues were resolved since they create noice in logs.


PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/wordpress/wp-content/plugins/wordpress-fieldmanager/php/class-fieldmanager-group.php on line 406

PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/wordpress-develop/src/wp-includes/functions.php on line 7127

PHP Deprecated:  strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/wordpress/wp-content/plugins/wordpress-fieldmanager/php/class-fieldmanager-field.php on line 992

... more ...

Also, consider using convertDeprecationsToExceptions="true" in the phpunit.xml so that a test fails if it contains PHP deprecations.

Use Case

Testing the test suite returns no PHP deprecations.

Acceptance Criteria

  • Add checks to ensure that values are strings before running them through string functions in the three locations identified above
  • Update the unit test configuration so that deprecations are converted to exceptions and require resolution before merging a PR

@anubisthejackle anubisthejackle marked this pull request as ready for review February 29, 2024 18:13
Copy link
Copy Markdown
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to address before merge, otherwise 🍣

@mogmarsh mogmarsh merged commit a63b186 into main Mar 21, 2024
@mogmarsh mogmarsh deleted the fix/issue-864/resolve-php-deprecations-in-tests branch March 21, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants