|
33 | 33 | ($modelA = new WorkflowableModel)->setDefaultWorkflowName($this->workflowA->name)->save(); |
34 | 34 | ($modelB = new WorkflowableModel)->setDefaultWorkflowName($this->workflowB->name)->save(); |
35 | 35 |
|
| 36 | + $modelA->usingWorkflow($modelA->getDefaultWorkflow()); |
36 | 37 | expect($modelA->modelStatus->workflow)->id->toBe($this->workflowA->id); |
37 | | - expect($modelB->modelStatus->workflow)->id->toEqual($this->workflowB->id); |
38 | | - |
39 | 38 | expect($modelA->transition($this->entryA_to_A1)) |
40 | 39 | ->modelStatus->status->toEqual($this->entryA_to_A1->toStatus); |
41 | | - expect($modelB->transition($this->entryB_to_B1)) |
42 | | - ->modelStatus->status->toEqual($this->entryB_to_B1->toStatus); |
43 | | - |
44 | 40 | expect($modelA->possibleTransitions())->toHaveCount(2); |
45 | | - expect($modelB->possibleTransitions())->toHaveCount(2); |
46 | | - |
47 | 41 | expect($modelA->transition($this->A1_to_exitA)) |
48 | 42 | ->modelStatus->status->toEqual($this->A1_to_exitA->toStatus); |
| 43 | + expect($modelA->possibleTransitions())->toHaveCount(0); |
| 44 | + expect($modelA->isInFinalStatus())->toBeTrue(); |
| 45 | + |
| 46 | + $modelB->usingWorkflow($modelB->getDefaultWorkflow()); |
| 47 | + expect($modelB->modelStatus->workflow)->id->toEqual($this->workflowB->id); |
| 48 | + expect($modelB->transition($this->entryB_to_B1)) |
| 49 | + ->modelStatus->status->toEqual($this->entryB_to_B1->toStatus); |
| 50 | + expect($modelB->possibleTransitions())->toHaveCount(2); |
49 | 51 | expect($modelB->transition($this->B1_to_B2)) |
50 | 52 | ->modelStatus->status->toEqual($this->B1_to_B2->toStatus); |
51 | | - |
52 | | - expect($modelA->possibleTransitions())->toHaveCount(0); |
53 | 53 | expect($modelB->possibleTransitions())->toHaveCount(1); |
54 | | - |
55 | | - expect($modelA->isInFinalStatus())->toBeTrue(); |
56 | 54 | expect($modelB->isInFinalStatus())->toBeFalse(); |
57 | 55 | }); |
58 | 56 |
|
|
0 commit comments