public function testWorkflowCreationSuccess() { $this->specify('create a workflow instance', function () { $w = new Workflow(['id' => 'workflow1', 'initialStatusId' => 'draft']); expect("workflow id should be 'workflow1'", $w->getId() == 'workflow1')->true(); expect("initial status id should be 'draft'", $w->getInitialStatusId() == 'draft')->true(); }); }
public function testAccessorFails() { // creating a Workflow with 'new' will not allow to use some accessors $w = new Workflow(['id' => 'wid', 'initialStatusId' => 'A']); $this->specify('fails to get initial status if no source component is available', function () use($w) { $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available'); $w->getInitialStatus(); }); $this->specify('fails to get all statues if no source component is available', function () use($w) { $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available'); $w->getAllStatuses(); }); }