Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292927

[meta] Replace assertions with more appropriate ones

$
0
0

See the overall status of the issues connected to this meta in the kanban board.

Problem/Motivation

Wherever possible, use specific PHPUnit default assertions, that also provide standard messaging in case of assertion failure. PHPUnit's list @ https://phpunit.readthedocs.io/en/8.5/assertions.html is the best starting point to understand what default PHPUnit provides.

However, beware of PHPUnit's own deprecations -- the most accurate list is PHPUnit 9 at the moment, https://phpunit.readthedocs.io/en/9.1/assertions.html. Drupal does not support PHPUnit 9 yet, but has already removed usage of methods deprecated in PHPUnit 8 in #3110543: [meta] Support PHPUnit 9 in Drupal 9.

For example: assertSame(*, count()) can be replaced by assertCount().

Issues open:

RTBC'd:

Pending backport to D8:

  • None presently.

Done:

Proposed resolution

Add child issues for each case and replace them.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 292927

Trending Articles