From 00c2311c5dfa479e88fd89854f2099a3959303ea Mon Sep 17 00:00:00 2001 From: dmason30 Date: Sat, 26 Feb 2022 17:45:48 +0000 Subject: [PATCH] Replace assertDeleted with assertModelMissing --- src/Generators/TestGenerator.php | 2 +- tests/fixtures/tests/api-shorthand-validation.php | 2 +- tests/fixtures/tests/certificate-pascal-case-example.php | 2 +- tests/fixtures/tests/certificate-type-pascal-case-example.php | 2 +- tests/fixtures/tests/full-crud-example.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Generators/TestGenerator.php b/src/Generators/TestGenerator.php index 3a975182..07bdb13e 100644 --- a/src/Generators/TestGenerator.php +++ b/src/Generators/TestGenerator.php @@ -419,7 +419,7 @@ protected function buildTestCases(Controller $controller) if (!is_null($local_model) && $local_model->usesSoftDeletes()) { $assertions['generic'][] = sprintf('$this->assertSoftDeleted($%s);', $variable); } else { - $assertions['generic'][] = sprintf('$this->assertDeleted($%s);', $variable); + $assertions['generic'][] = sprintf('$this->assertModelMissing($%s);', $variable); } } elseif ($statement->operation() === 'update') { $assertions['sanity'][] = sprintf('$%s->refresh();', $variable); diff --git a/tests/fixtures/tests/api-shorthand-validation.php b/tests/fixtures/tests/api-shorthand-validation.php index e88ac574..038e112b 100644 --- a/tests/fixtures/tests/api-shorthand-validation.php +++ b/tests/fixtures/tests/api-shorthand-validation.php @@ -147,6 +147,6 @@ public function destroy_deletes_and_responds_with() $response->assertNoContent(); - $this->assertDeleted($certificate); + $this->assertModelMissing($certificate); } } diff --git a/tests/fixtures/tests/certificate-pascal-case-example.php b/tests/fixtures/tests/certificate-pascal-case-example.php index e88ac574..038e112b 100644 --- a/tests/fixtures/tests/certificate-pascal-case-example.php +++ b/tests/fixtures/tests/certificate-pascal-case-example.php @@ -147,6 +147,6 @@ public function destroy_deletes_and_responds_with() $response->assertNoContent(); - $this->assertDeleted($certificate); + $this->assertModelMissing($certificate); } } diff --git a/tests/fixtures/tests/certificate-type-pascal-case-example.php b/tests/fixtures/tests/certificate-type-pascal-case-example.php index 5a4030ea..c688deb8 100644 --- a/tests/fixtures/tests/certificate-type-pascal-case-example.php +++ b/tests/fixtures/tests/certificate-type-pascal-case-example.php @@ -121,6 +121,6 @@ public function destroy_deletes_and_responds_with() $response->assertNoContent(); - $this->assertDeleted($certificateType); + $this->assertModelMissing($certificateType); } } diff --git a/tests/fixtures/tests/full-crud-example.php b/tests/fixtures/tests/full-crud-example.php index e6a7b48a..3a007f02 100644 --- a/tests/fixtures/tests/full-crud-example.php +++ b/tests/fixtures/tests/full-crud-example.php @@ -155,6 +155,6 @@ public function destroy_deletes() $response = $this->delete(route('post.destroy', $post)); - $this->assertDeleted($post); + $this->assertModelMissing($post); } }