// Transitions are stored in alphabetical key order in configuration.
$this->
assertEquals(['a_a', 'a_b'
],
array_keys($workflow->
getTypePlugin()->
getConfiguration()['transitions'
]));
// Ensure we're returning transition objects.
$this->
assertInstanceOf(Transition::
class,
$workflow->
getTypePlugin()->
getTransitions()['a_a'
]);
// Passing in no IDs returns all transitions.
$this->
assertEquals(['a_b', 'a_a'
],
array_keys($workflow->
getTypePlugin()->
getTransitions()));
// The order of states is by weight.
$workflow->
getTypePlugin()->
setTransitionWeight('a_a', -1
);
$this->
assertEquals(['a_a', 'a_b'
],
array_keys($workflow->
getTypePlugin()->
getTransitions()));
// If all weights are equal it will fallback to labels.
$workflow->
getTypePlugin()->
setTransitionWeight('a_a', 0
);
$this->
assertEquals(['a_a', 'a_b'
],
array_keys($workflow->
getTypePlugin()->
getTransitions()));
$workflow->
getTypePlugin()->
setTransitionLabel('a_b', 'A B'
);
$this->
assertEquals(['a_b', 'a_a'
],
array_keys($workflow->
getTypePlugin()->
getTransitions()));
// You can limit the states returned by passing in states IDs.
$this->
assertEquals(['a_a'
],
array_keys($workflow->
getTypePlugin()->
getTransitions(['a_a'
])));