Пример #1
0
 public function testEnterWorkflowSuccess()
 {
     $item = new Item04();
     $this->specify('model is inserted in the default workflow', function () use($item) {
         verify('current status is not set', $item->hasWorkflowStatus())->false();
         $item->enterWorkflow();
         verify('current status is set', $item->hasWorkflowStatus())->true();
         verify('current status is ok', $item->workflowStatus->getId())->equals('Item04Workflow/A');
         //verify('current status is the initial status for the current workflow', $item->engine->getInitialStatus($item->getWorkflowId())->getId() )->equals($item->currentStatus->id);
         verify('item can be saved', $item->save())->true();
         $newitem = Item04::findOne(['id' => $item->id]);
         verify('current status is set', $newitem->hasWorkflowStatus())->true();
         verify('current status is ok', $newitem->workflowStatus->getId())->equals('Item04Workflow/A');
     });
 }