private Transition
$t1;
protected function setUp(): void
{ $places =
['ordered', 'waiting_for_payment', 'processed'
];
$transitions =
[ $this->t1 =
new Transition('t1', 'ordered', 'waiting_for_payment'
),
new Transition('t2', 'waiting_for_payment', 'processed'
),
];
$transitionsMetadata =
new \
SplObjectStorage();
$transitionsMetadata->
attach($this->t1,
['title' => 't1 title'
]);
$metadataStore =
new InMemoryMetadataStore( ['title' => 'workflow title'
],
['orderer' =>
['title' => 'ordered title'
]],
$transitionsMetadata );
$definition =
new Definition($places,
$transitions, null,
$metadataStore);
$workflow =
new Workflow($definition,
new MethodMarkingStore());
$registry =
new Registry();
$supportStrategy =
new InstanceOfSupportStrategy(Subject::
class);
$registry->
addWorkflow($workflow,
$supportStrategy);