diff core/tests/Drupal/Tests/UnitTestCaseDeprecationTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/tests/Drupal/Tests/UnitTestCaseDeprecationTest.php	Mon Apr 23 09:46:53 2018 +0100
@@ -0,0 +1,22 @@
+<?php
+
+namespace Drupal\Tests;
+
+/**
+ * @coversDefaultClass \Drupal\Tests\UnitTestCase
+ *
+ * @group Test
+ * @group legacy
+ */
+class UnitTestCaseDeprecationTest extends UnitTestCase {
+
+  /**
+   * @covers ::getBlockMockWithMachineName
+   * @expectedDeprecation Drupal\Tests\UnitTestCase::getBlockMockWithMachineName is deprecated in Drupal 8.5.x, will be removed before Drupal 9.0.0. Unit test base classes should not have dependencies on extensions. Set up mocks in individual tests.
+   */
+  public function testDeprecatedGetBlockMockWithMachineName() {
+    $block_mock = $this->getBlockMockWithMachineName('test_name');
+    $this->assertEquals('test_name', $block_mock->getPlugin()->getMachineNameSuggestion());
+  }
+
+}