function RequiredStatesTest::testNoStatesRequiredStateAPI
Same name in other branches
- 9 core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testNoStatesRequiredStateAPI()
- 8.9.x core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testNoStatesRequiredStateAPI()
- 10 core/modules/workflows/tests/src/Kernel/RequiredStatesTest.php \Drupal\Tests\workflows\Kernel\RequiredStatesTest::testNoStatesRequiredStateAPI()
@covers \Drupal\workflows\Entity\Workflow::preSave
File
-
core/
modules/ workflows/ tests/ src/ Kernel/ RequiredStatesTest.php, line 65
Class
- RequiredStatesTest
- Tests Workflow type's required states and configuration initialization.
Namespace
Drupal\Tests\workflows\KernelCode
public function testNoStatesRequiredStateAPI() : void {
$workflow = Workflow::create([
'id' => 'test',
'type' => 'workflow_type_required_state_test',
'type_settings' => [
'states' => [],
],
]);
$this->expectException(RequiredStateMissingException::class);
$this->expectExceptionMessage("Required State Type Test' requires states with the ID 'fresh', 'rotten' in workflow 'test'");
$workflow->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.