protected function WorkflowTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/workflows/tests/src/Unit/WorkflowTest.php \Drupal\Tests\workflows\Unit\WorkflowTest::setUp()
- 9 core/modules/workflows/tests/src/Unit/WorkflowTest.php \Drupal\Tests\workflows\Unit\WorkflowTest::setUp()
File
- core/
modules/ workflows/ tests/ src/ Unit/ WorkflowTest.php, line 24
Class
- WorkflowTest
- @coversDefaultClass \Drupal\workflows\Plugin\WorkflowTypeBase
Namespace
Drupal\Tests\workflows\UnitCode
protected function setUp() : void {
parent::setUp();
// Create a container so that the plugin manager and workflow type can be
// mocked.
$container = new ContainerBuilder();
$workflow_manager = $this
->prophesize(WorkflowTypeManager::class);
$workflow_manager
->createInstance('test_type', Argument::any())
->willReturn(new TestType([], '', []));
$container
->set('plugin.manager.workflows.type', $workflow_manager
->reveal());
\Drupal::setContainer($container);
}