function UnitTestCaseDeprecationTest::testDeprecatedGetBlockMockWithMachineName

@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.

File

core/tests/Drupal/Tests/UnitTestCaseDeprecationTest.php, line 17

Class

UnitTestCaseDeprecationTest
@coversDefaultClass \Drupal\Tests\UnitTestCase

Namespace

Drupal\Tests

Code

public function testDeprecatedGetBlockMockWithMachineName() {
    $block_mock = $this->getBlockMockWithMachineName('test_name');
    $this->assertEquals('test_name', $block_mock->getPlugin()
        ->getMachineNameSuggestion());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.