class ExpectDeprecationTest
Ensures Drupal has test coverage of Symfony's deprecation testing.
Attributes
#[Group('Test')]
#[IgnoreDeprecations]
  Hierarchy
- class \Drupal\Tests\ExpectDeprecationTest uses \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of ExpectDeprecationTest
File
- 
              core/tests/ Drupal/ Tests/ ExpectDeprecationTest.php, line 17 
Namespace
Drupal\TestsView source
class ExpectDeprecationTest extends TestCase {
  use ExpectDeprecationTrait;
  
  /**
   * Tests expectDeprecation.
   */
  public function testExpectDeprecation() : void {
    $this->expectDeprecation('Test deprecation');
    // phpcs:ignore Drupal.Semantics.FunctionTriggerError
    @trigger_error('Test deprecation', E_USER_DEPRECATED);
  }
  
  /**
   * Tests expectDeprecation in isolated test.
   */
  public function testExpectDeprecationInIsolation() : void {
    $this->expectDeprecation('Test isolated deprecation');
    // phpcs:ignore Drupal.Semantics.FunctionTriggerError
    @trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
  }
}Members
| Title Sort descending | Modifiers | Object type | Summary | 
|---|---|---|---|
| ExpectDeprecationTest::testExpectDeprecation | public | function | Tests expectDeprecation. | 
| ExpectDeprecationTest::testExpectDeprecationInIsolation | public | function | Tests expectDeprecation in isolated test. | 
| ExpectDeprecationTrait::expectDeprecation | public | function | Adds an expected deprecation. | 
| ExpectDeprecationTrait::setUpErrorHandler | public | function | Sets up the test error handler. | 
| ExpectDeprecationTrait::tearDownErrorHandler | public | function | Tears down the test error handler. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
