Change record status: 
Project: 
Introduced in branch: 
8.8.x
Introduced in version: 
8.8.0-alpha1
Description: 

It's standard practice in PHPUnit tests to mark tests that don't make an assertion as risky. This is because without making any assertions you are not really testing any assumptions beyond any code being executed is not triggering an error.

Previously \Drupal\KernelTests\KernelTestBase always made one assertion which would hide tests that did not preform any assertions themselves.This could give a sense of false confidence to the author of these tests. KernelTestBase will now no longer perform one assertion which means that kernel tests that don't perform any assertions will now be marked as risky and will fail on Drupal CI.

To deal with this you can do one of the following things:

  • Add an assertion to the test method.
  • Mark the test method with @doesNotPerformAssertions
  • Mark the test as skipped with $this->markTestSkipped("Reason this should be skipped");
Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done