function AssertLegacyTrait::assert

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/AssertLegacyTrait.php \Drupal\KernelTests\AssertLegacyTrait::assert()

Deprecated

in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertTrue() instead.

See also

\Drupal\simpletest\TestBase::assert()

https://www.drupal.org/node/3129738

1 call to AssertLegacyTrait::assert()
KernelTestBaseTest::testAssert in core/tests/Drupal/KernelTests/KernelTestBaseTest.php
Tests the deprecation of AssertLegacyTrait::assert.

File

core/tests/Drupal/KernelTests/AssertLegacyTrait.php, line 26

Class

AssertLegacyTrait
Translates Simpletest assertion methods to PHPUnit.

Namespace

Drupal\KernelTests

Code

protected function assert($actual, $message = '') {
    @trigger_error('AssertLegacyTrait::assert() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertTrue() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    parent::assertTrue((bool) $actual, $message);
}

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