function DevelGenerateManagerTest::setUp

Same name in other branches
  1. 4.x devel_generate/tests/src/Unit/DevelGenerateManagerTest.php \Drupal\Tests\devel_generate\Unit\DevelGenerateManagerTest::setUp()

Overrides UnitTestCase::setUp

File

devel_generate/tests/src/Unit/DevelGenerateManagerTest.php, line 34

Class

DevelGenerateManagerTest
@coversDefaultClass \Drupal\devel_generate\DevelGeneratePluginManager @group devel_generate

Namespace

Drupal\Tests\devel_generate\Unit

Code

protected function setUp() : void {
    parent::setUp();
    // Mock the plugin discovery.
    $this->discovery = $this->createMock(DiscoveryInterface::class);
    $this->discovery
        ->expects($this->any())
        ->method('getDefinitions')
        ->willReturnCallback(function () : array {
        return $this->getMockDefinitions();
    });
}