Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / ExpectDeprecationTest.php
1 <?php
2
3 namespace Drupal\Tests;
4
5 use Drupal\Tests\Traits\ExpectDeprecationTrait;
6
7 /**
8  * @coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait
9  *
10  * @group Test
11  * @group legacy
12  */
13 class ExpectDeprecationTest extends UnitTestCase {
14   use ExpectDeprecationTrait;
15
16   /**
17    * @covers ::expectDeprecation
18    */
19   public function testExpectDeprecation() {
20     $this->expectDeprecation('Test deprecation');
21     @trigger_error('Test deprecation', E_USER_DEPRECATED);
22   }
23
24   /**
25    * @covers ::expectDeprecation
26    * @runInSeparateProcess
27    * @preserveGlobalState disabled
28    */
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);
34   }
35
36 }