public function testAttachFails3() { $this->specify('the status attribute must exist in the owner model', function () { $model = new Item01(); $model->detachBehavior('workflow'); $model->attachBehavior('workflow', ['class' => SimpleWorkflowBehavior::className(), 'statusAttribute' => 'not_found']); }, ['throws' => 'yii\\base\\InvalidConfigException']); }
public function testInitStatusAfterFindFails() { $this->specify('status initialisation success when saving model', function () { $model = new Item01(); $model->detachBehavior('workflow'); $model->id = 1; $model->name = 'name'; $model->status = 'Workflow1/X'; $model->save(false); $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'No status found with id Workflow1/X'); $model = Item01::findOne(1); }); }