File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ public function transition(Transition $transition): Model
152152 }
153153
154154 $ model = app ()->call ([$ transition , 'handle ' ]);
155+ $ model ->{$ this ->field }->setField ($ this ->field );
155156
156157 event (new StateChanged (
157158 $ this ,
Original file line number Diff line number Diff line change @@ -163,4 +163,19 @@ public function event_is_triggered_after_transition()
163163 && $ event ->model ->is ($ model );
164164 });
165165 }
166+
167+ /** @test */
168+ public function can_transition_twice ()
169+ {
170+ $ model = TestModel::create ([
171+ 'state ' => StateA::class,
172+ ]);
173+
174+ $ model ->state ->transitionTo (StateB::class);
175+ $ model ->state ->transitionTo (StateC::class);
176+
177+ $ model ->refresh ();
178+
179+ $ this ->assertInstanceOf (StateC::class, $ model ->state );
180+ }
166181}
You can’t perform that action at this time.
0 commit comments