Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / tests / Drupal / Tests / ExpectDeprecationTest.php
diff --git a/web/core/tests/Drupal/Tests/ExpectDeprecationTest.php b/web/core/tests/Drupal/Tests/ExpectDeprecationTest.php
new file mode 100644 (file)
index 0000000..aefb6a0
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\Tests;
+
+use Drupal\Tests\Traits\ExpectDeprecationTrait;
+
+/**
+ * @coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait
+ *
+ * @group Test
+ * @group legacy
+ */
+class ExpectDeprecationTest extends UnitTestCase {
+  use ExpectDeprecationTrait;
+
+  /**
+   * @covers ::expectDeprecation
+   */
+  public function testExpectDeprecation() {
+    $this->expectDeprecation('Test deprecation');
+    @trigger_error('Test deprecation', E_USER_DEPRECATED);
+  }
+
+  /**
+   * @covers ::expectDeprecation
+   * @runInSeparateProcess
+   * @preserveGlobalState disabled
+   */
+  public function testExpectDeprecationInIsolation() {
+    $this->expectDeprecation('Test isolated deprecation');
+    $this->expectDeprecation('Test isolated deprecation2');
+    @trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
+    @trigger_error('Test isolated deprecation2', E_USER_DEPRECATED);
+  }
+
+}