class Validator in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 tests/src/Unit/StateTransitionValidationTest.php \Drupal\Tests\workbench_moderation\Unit\Validator
Testable subclass for selected tests.
EntityQuery is beyond untestable, so we have to subclass and override the method that uses it.
Hierarchy
- class \Drupal\workbench_moderation\StateTransitionValidation
- class \Drupal\Tests\workbench_moderation\Unit\Validator
Expanded class hierarchy of Validator
File
- tests/
src/ Unit/ StateTransitionValidationTest.php, line 242
Namespace
Drupal\Tests\workbench_moderation\UnitView source
class Validator extends StateTransitionValidation {
/**
* @inheritDoc
*/
protected function getTransitionFromStates($from, $to) {
if ($from == 'draft' && $to == 'draft') {
return $this
->transitionStorage()
->loadMultiple([
'draft__draft',
])[0];
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StateTransitionValidation:: |
protected | property | ||
StateTransitionValidation:: |
protected | property | Stores the possible state transitions. | |
StateTransitionValidation:: |
protected | property | ||
StateTransitionValidation:: |
protected | function | Computes a mapping of possible transitions. | |
StateTransitionValidation:: |
protected | function | Returns a mapping of possible transitions. | |
StateTransitionValidation:: |
protected | function | Returns a list of transitions from a given state. | |
StateTransitionValidation:: |
public | function | Gets a list of transitions that are legal for this user on this entity. | |
StateTransitionValidation:: |
public | function | Gets a list of states a user may transition an entity to. | |
StateTransitionValidation:: |
public | function | Determines a transition allowed. | |
StateTransitionValidation:: |
protected | function | Loads a specific bundle entity. | |
StateTransitionValidation:: |
protected | function | Returns the state entity storage service. | |
StateTransitionValidation:: |
protected | function | ||
StateTransitionValidation:: |
protected | function | Returns the transition entity storage service. | |
StateTransitionValidation:: |
public | function | Determines if a user is allowed to transition from one state to another. | |
StateTransitionValidation:: |
public | function | Constructs a new StateTransitionValidation. | |
Validator:: |
protected | function |
@inheritDoc Overrides StateTransitionValidation:: |