File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 22
22
use App \Models \Post ;
23
23
use App \Schemas \PostSchema ;
24
24
25
- class SoftDeleteTest extends TestCase
25
+ class Test extends TestCase
26
26
{
27
27
28
28
/**
@@ -124,19 +124,18 @@ public function testQueryOne($deleted): void
124
124
*/
125
125
public function testItForceDeletesModel ($ deleted ): void
126
126
{
127
- // Unlike Eloquent's SoftDeletes trait, there is no `forceDeleted` event on SoftDeletesBoolean
128
- // $forceDeleted = false;
129
- //
130
- // Post::forceDeleted(function () use (&$forceDeleted) {
131
- // $forceDeleted = true;
132
- // });
127
+ $ forceDeleted = false ;
128
+
129
+ Post::forceDeleted (function () use (&$ forceDeleted ) {
130
+ $ forceDeleted = true ;
131
+ });
133
132
134
133
$ post = Post::factory ()->create (['is_deleted ' => $ deleted ]);
135
134
136
135
$ this ->schema ->repository ()->delete ((string ) $ post ->getRouteKey ());
137
136
138
137
$ this ->assertDeleted ($ post );
139
- // $this->assertTrue($forceDeleted);
138
+ $ this ->assertTrue ($ forceDeleted );
140
139
}
141
140
142
141
public function testItDoesNotRestoreOnCreate (): void
@@ -506,9 +505,9 @@ private function willNotRestore(): self
506
505
*/
507
506
private function willNotForceDelete (): self
508
507
{
509
- // Post::forceDeleted(function () {
510
- // throw new \LogicException('Not expecting a restore event.');
511
- // });
508
+ Post::forceDeleted (function () {
509
+ throw new \LogicException ('Not expecting a restore event. ' );
510
+ });
512
511
513
512
return $ this ;
514
513
}
You can’t perform that action at this time.
0 commit comments