Skip to content

Commit 20e3076

Browse files
authored
Replace assertDeleted with assertModelMissing (#554)
1 parent bb11d59 commit 20e3076

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/Generators/TestGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ protected function buildTestCases(Controller $controller)
419419
if (!is_null($local_model) && $local_model->usesSoftDeletes()) {
420420
$assertions['generic'][] = sprintf('$this->assertSoftDeleted($%s);', $variable);
421421
} else {
422-
$assertions['generic'][] = sprintf('$this->assertDeleted($%s);', $variable);
422+
$assertions['generic'][] = sprintf('$this->assertModelMissing($%s);', $variable);
423423
}
424424
} elseif ($statement->operation() === 'update') {
425425
$assertions['sanity'][] = sprintf('$%s->refresh();', $variable);

tests/fixtures/tests/api-shorthand-validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ public function destroy_deletes_and_responds_with()
147147

148148
$response->assertNoContent();
149149

150-
$this->assertDeleted($certificate);
150+
$this->assertModelMissing($certificate);
151151
}
152152
}

tests/fixtures/tests/certificate-pascal-case-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@ public function destroy_deletes_and_responds_with()
147147

148148
$response->assertNoContent();
149149

150-
$this->assertDeleted($certificate);
150+
$this->assertModelMissing($certificate);
151151
}
152152
}

tests/fixtures/tests/certificate-type-pascal-case-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ public function destroy_deletes_and_responds_with()
121121

122122
$response->assertNoContent();
123123

124-
$this->assertDeleted($certificateType);
124+
$this->assertModelMissing($certificateType);
125125
}
126126
}

tests/fixtures/tests/full-crud-example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ public function destroy_deletes()
155155

156156
$response = $this->delete(route('post.destroy', $post));
157157

158-
$this->assertDeleted($post);
158+
$this->assertModelMissing($post);
159159
}
160160
}

0 commit comments

Comments
 (0)