3 namespace Drupal\Tests;
5 use Drupal\Tests\Traits\ExpectDeprecationTrait;
8 * @coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait
13 class ExpectDeprecationTest extends UnitTestCase {
14 use ExpectDeprecationTrait;
17 * @covers ::expectDeprecation
19 public function testExpectDeprecation() {
20 $this->expectDeprecation('Test deprecation');
21 @trigger_error('Test deprecation', E_USER_DEPRECATED);
25 * @covers ::expectDeprecation
26 * @runInSeparateProcess
27 * @preserveGlobalState disabled
29 public function testExpectDeprecationInIsolation() {
30 $this->expectDeprecation('Test isolated deprecation');
31 $this->expectDeprecation('Test isolated deprecation2');
32 @trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
33 @trigger_error('Test isolated deprecation2', E_USER_DEPRECATED);