You are here

class ExpectDeprecationTest in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/ExpectDeprecationTest.php \Drupal\Tests\ExpectDeprecationTest
  2. 9 core/tests/Drupal/Tests/ExpectDeprecationTest.php \Drupal\Tests\ExpectDeprecationTest

Ensures Drupal has test coverage of Symfony's deprecation testing.

@group Test @group legacy

Hierarchy

  • class \Drupal\Tests\ExpectDeprecationTest extends \PHPUnit\Framework\TestCase uses \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait

Expanded class hierarchy of ExpectDeprecationTest

File

core/tests/Drupal/Tests/ExpectDeprecationTest.php, line 14

Namespace

Drupal\Tests
View source
class ExpectDeprecationTest extends TestCase {
  use ExpectDeprecationTrait;

  /**
   * Tests expectDeprecation.
   */
  public function testExpectDeprecation() {
    $this
      ->expectDeprecation('Test deprecation');
    @trigger_error('Test deprecation', E_USER_DEPRECATED);
  }

  /**
   * Tests expectDeprecation in isolated test.
   *
   * @runInSeparateProcess
   * @preserveGlobalState disabled
   */
  public function testExpectDeprecationInIsolation() {
    $this
      ->expectDeprecation('Test isolated deprecation');
    @trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
  }

}

Members