diff --git a/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php b/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php index 7407f43fc2..81c7d2e4ef 100644 --- a/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php +++ b/core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php @@ -23,30 +23,30 @@ class WorkflowCustomAccessType extends WorkflowTypeBase { public function defaultConfiguration() { return [ 'states' => [ - 'can_not_update' => [ - 'label' => 'Can Not Update State', + 'cannot_update' => [ + 'label' => 'Cannot Update State', 'weight' => 0, ], - 'can_not_delete' => [ - 'label' => 'Can Not Delete State', + 'cannot_delete' => [ + 'label' => 'Cannot Delete State', 'weight' => 0, ], ], 'transitions' => [ - 'can_not_update' => [ - 'label' => 'Can Not Update Transition', - 'to' => 'can_not_update', + 'cannot_update' => [ + 'label' => 'Cannot Update Transition', + 'to' => 'cannot_update', 'weight' => 0, 'from' => [ - 'can_not_update', + 'cannot_update', ], ], - 'can_not_delete' => [ - 'label' => 'Can Not Delete Transition', - 'to' => 'can_not_delete', + 'cannot_delete' => [ + 'label' => 'Cannot Delete Transition', + 'to' => 'cannot_delete', 'weight' => 1, 'from' => [ - 'can_not_delete', + 'cannot_delete', ], ], ], @@ -60,10 +60,9 @@ public function defaultConfiguration() { */ public static function workflowAccess(WorkflowInterface $entity, $operation, AccountInterface $account) { $forbidden_operations = \Drupal::state()->get('workflow_type_test_forbidden_operations', []); - if (in_array($operation, $forbidden_operations)) { - return AccessResult::forbidden(); - } - return AccessResult::neutral(); + return in_array($operation, $forbidden_operations, TRUE) + ? AccessResult::forbidden() + : AccessResult::neutral(); } } diff --git a/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php b/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php index 847deac26e..327b172558 100644 --- a/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php +++ b/core/modules/workflows/tests/src/Functional/WorkflowCustomStateTransitionAccessTest.php @@ -54,10 +54,10 @@ protected function setUp() { public function testCustomWorkflowAccessOperations() { $this->drupalLogin($this->adminUser); $forbidden_paths = [ - 'admin/config/workflow/workflows/manage/test_type/state/can_not_delete/delete', - 'admin/config/workflow/workflows/manage/test_type/state/can_not_update', - 'admin/config/workflow/workflows/manage/test_type/transition/can_not_update', - 'admin/config/workflow/workflows/manage/test_type/transition/can_not_delete/delete', + 'admin/config/workflow/workflows/manage/test_type/state/cannot_delete/delete', + 'admin/config/workflow/workflows/manage/test_type/state/cannot_update', + 'admin/config/workflow/workflows/manage/test_type/transition/cannot_update', + 'admin/config/workflow/workflows/manage/test_type/transition/cannot_delete/delete', 'admin/config/workflow/workflows/manage/test_type/add_state', 'admin/config/workflow/workflows/manage/test_type/add_transition', ]; @@ -71,10 +71,10 @@ public function testCustomWorkflowAccessOperations() { // Update the forbidden operations which deny access to the actions // represented by the above paths. $this->container->get('state')->set('workflow_type_test_forbidden_operations', [ - 'update-state:can_not_update', - 'delete-state:can_not_delete', - 'update-transition:can_not_update', - 'delete-transition:can_not_delete', + 'update-state:cannot_update', + 'delete-state:cannot_delete', + 'update-transition:cannot_update', + 'delete-transition:cannot_delete', 'add-state', 'add-transition', ]);