Active
Project:
Drupal core
Version:
main
Component:
phpunit
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 May 2020 at 22:49 UTC
Updated:
6 May 2020 at 15:32 UTC
Jump to comment: Most recent
In #3128573: [meta] Replace assertions with more appropriate ones we are modernising Drupal's test suite to remove Simpletest-isms and replace them with more PHPUnit assertions.
We can start going further by creating our own assertions for things that are commonly tested in Drupal. This will improve test readability and DX.
Add custom assertions to either test base classes or traits, as described at https://phpunit.readthedocs.io/en/9.0/extending-phpunit.html
Identify common things that we test for.
Figure out the best way of converting these to PHPUnit Constraint classes and where to put them in the Drupal namespace.
Create child issues to add the new assertions and convert existing uses.
Comments
Comment #2
longwaveComment #3
mondrakeFiled #3133355: Introduce PHPUnit-compliant WebAssert::responseHeaderExists() method, and its negative.
Comment #4
jungle+1 to this, subscribing.