public function PhpUnitBridgeTest::testDeprecatedClass in Drupal 10
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php \Drupal\Tests\Core\Test\PhpUnitBridgeTest::testDeprecatedClass()
- 10 core/tests/Drupal/KernelTests/Core/Test/PhpUnitBridgeTest.php \Drupal\KernelTests\Core\Test\PhpUnitBridgeTest::testDeprecatedClass()
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php \Drupal\Tests\Core\Test\PhpUnitBridgeTest::testDeprecatedClass()
- 9 core/tests/Drupal/Tests/Core/Test/PhpUnitBridgeTest.php \Drupal\Tests\Core\Test\PhpUnitBridgeTest::testDeprecatedClass()
Tests class-level deprecation.
File
- core/
tests/ Drupal/ Tests/ Core/ Test/ PhpUnitBridgeTest.php, line 19
Class
- PhpUnitBridgeTest
- Test how unit tests interact with deprecation errors.
Namespace
Drupal\Tests\Core\TestCode
public function testDeprecatedClass() {
$this
->expectDeprecation('Drupal\\deprecation_test\\Deprecation\\FixtureDeprecatedClass is deprecated.');
$deprecated = new FixtureDeprecatedClass();
$this
->assertEquals('test', $deprecated
->testFunction());
}