public function testConvertionOnLeaveWorkflow() { $item = new Item04(); $item->attachBehavior('workflow', ['class' => SimpleWorkflowBehavior::className(), 'statusConverter' => 'converter']); $this->assertEquals(null, $item->status); $this->assertEquals('Item04Workflow/B', $item->getWorkflowStatus()->getId()); $this->specify('convertion is done when leaving workflow', function () use($item) { $item->sendToStatus(null); expect('item to not be in a workflow', $item->getWorkflow())->equals(null); expect('item to not have status', $item->hasWorkflowStatus())->false(); expect('status attribut to be converted into 55', $item->status)->equals(55); }); }