function TestCompatibilityTrait::assertFalse

Same name in this branch
  1. 8.9.x core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit7/TestCompatibilityTrait.php \Drupal\TestTools\PhpUnitCompatibility\PhpUnit7\TestCompatibilityTrait::assertFalse()

@todo deprecate this method override in https://www.drupal.org/project/drupal/issues/2742585

See also

\Drupal\simpletest\TestBase::assertFalse()

File

core/tests/Drupal/TestTools/PhpUnitCompatibility/PhpUnit6/TestCompatibilityTrait.php, line 32

Class

TestCompatibilityTrait
Makes Drupal's test API forward compatible with multiple versions of PHPUnit.

Namespace

Drupal\TestTools\PhpUnitCompatibility\PhpUnit6

Code

public static function assertFalse($actual, $message = '') {
    if (is_bool($actual)) {
        parent::assertFalse($actual, $message);
    }
    else {
        @trigger_error('Support for asserting against non-boolean values in ::assertFalse is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use a different assert method, for example, ::assertEmpty(). See https://www.drupal.org/node/3082086', E_USER_DEPRECATED);
        parent::assertEmpty($actual, $message);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.