function ComplexWorkflowTypeTest::testLoadMultipleByType
Same name in other branches
- 9 core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php \Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType()
- 10 core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php \Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType()
- 11.x core/modules/workflows/tests/src/Kernel/ComplexWorkflowTypeTest.php \Drupal\Tests\workflows\Kernel\ComplexWorkflowTypeTest::testLoadMultipleByType()
@covers \Drupal\workflows\Entity\Workflow::loadMultipleByType
File
-
core/
modules/ workflows/ tests/ src/ Kernel/ ComplexWorkflowTypeTest.php, line 25
Class
- ComplexWorkflowTypeTest
- Workflow entity tests that require modules or storage.
Namespace
Drupal\Tests\workflows\KernelCode
public function testLoadMultipleByType() {
$workflow1 = new Workflow([
'id' => 'test1',
'type' => 'workflow_type_complex_test',
], 'workflow');
$workflow1->save();
$workflow2 = new Workflow([
'id' => 'test2',
'type' => 'workflow_type_complex_test',
], 'workflow');
$workflow2->save();
$workflow3 = new Workflow([
'id' => 'test3',
'type' => 'workflow_type_test',
], 'workflow');
$workflow3->save();
$this->assertEquals([
'test1',
'test2',
], array_keys(Workflow::loadMultipleByType('workflow_type_complex_test')));
$this->assertEquals([
'test3',
], array_keys(Workflow::loadMultipleByType('workflow_type_test')));
$this->assertEquals([], Workflow::loadMultipleByType('a_type_that_does_not_exist'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.