@@ -269,7 +269,6 @@ public function testUpdateModelAfterSoftDeleting()
269269 /** @var SoftDeletesTestUser $userModel */
270270 $ userModel = SoftDeletesTestUser::find (2 );
271271 $ userModel ->delete ();
272- $ userModel ->syncOriginal ();
273272 $ this ->assertEquals ($ now ->toDateTimeString (), $ userModel ->getOriginal ('deleted_at ' ));
274273 $ this ->assertNull (SoftDeletesTestUser::find (2 ));
275274 $ this ->assertEquals ($ userModel , SoftDeletesTestUser::withTrashed ()->find (2 ));
@@ -285,7 +284,6 @@ public function testRestoreAfterSoftDelete()
285284 /** @var SoftDeletesTestUser $userModel */
286285 $ userModel = SoftDeletesTestUser::find (2 );
287286 $ userModel ->delete ();
288- $ userModel ->syncOriginal ();
289287 $ userModel ->restore ();
290288
291289 $ this ->assertEquals ($ userModel ->id , SoftDeletesTestUser::find (2 )->id );
@@ -304,12 +302,25 @@ public function testSoftDeleteAfterRestoring()
304302 $ this ->assertEquals ($ userModel ->deleted_at , SoftDeletesTestUser::find (1 )->deleted_at );
305303 $ this ->assertEquals ($ userModel ->getOriginal ('deleted_at ' ), SoftDeletesTestUser::find (1 )->deleted_at );
306304 $ userModel ->delete ();
307- $ userModel ->syncOriginal ();
308305 $ this ->assertNull (SoftDeletesTestUser::find (1 ));
309306 $ this ->assertEquals ($ userModel ->deleted_at , SoftDeletesTestUser::withTrashed ()->find (1 )->deleted_at );
310307 $ this ->assertEquals ($ userModel ->getOriginal ('deleted_at ' ), SoftDeletesTestUser::withTrashed ()->find (1 )->deleted_at );
311308 }
312309
310+ public function testModifyingBeforeSoftDeletingAndRestoring ()
311+ {
312+ $ this ->createUsers ();
313+
314+ /** @var SoftDeletesTestUser $userModel */
315+ $ userModel = SoftDeletesTestUser::find (2 );
316+ $ userModel->
email =
'[email protected] ' ;
317+ $ userModel ->delete ();
318+ $ userModel ->restore ();
319+
320+ $ this ->assertEquals ($ userModel ->id , SoftDeletesTestUser::find (2 )->id );
321+ $ this ->
assertSame (
'[email protected] ' , SoftDeletesTestUser::
find (
2 )->
email );
322+ }
323+
313324 public function testUpdateOrCreate ()
314325 {
315326 $ this ->createUsers ();
0 commit comments