UnitTestCaseDeprecationTest.php 718 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Drupal\Tests;
  3. /**
  4. * @coversDefaultClass \Drupal\Tests\UnitTestCase
  5. *
  6. * @group Test
  7. * @group legacy
  8. */
  9. class UnitTestCaseDeprecationTest extends UnitTestCase {
  10. /**
  11. * @covers ::getBlockMockWithMachineName
  12. * @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.
  13. */
  14. public function testDeprecatedGetBlockMockWithMachineName() {
  15. $block_mock = $this->getBlockMockWithMachineName('test_name');
  16. $this->assertEquals('test_name', $block_mock->getPlugin()->getMachineNameSuggestion());
  17. }
  18. }