Skip to content

Commit 8b48598

Browse files
committed
[Tests] Remove use of deprecated assertions
1 parent a4fff33 commit 8b48598

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/dummy/tests/Api/V1/Posts/DeleteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function test(): void
4949
->jsonApi()
5050
->delete(url('api/v1/posts', $this->post));
5151

52-
$response->assertDeleted();
52+
$response->assertNoContent();
5353

5454
$this->assertDatabaseMissing('posts', [
5555
'id' => $this->post->getKey(),

tests/dummy/tests/Api/V1/Posts/UpdateTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function test(): void
6464
->includePaths('author', 'tags')
6565
->patch(url('/api/v1/posts', $this->post));
6666

67-
$response->assertUpdated($expected);
67+
$response->assertFetchedOne($expected);
6868

6969
$this->assertDatabaseHas('posts', [
7070
'author_id' => $this->post->author->getKey(),
@@ -120,7 +120,7 @@ public function testIndividualField(string $fieldName): void
120120
->withData($data)
121121
->patch(url('/api/v1/posts', $this->post));
122122

123-
$response->assertUpdated($expected->jsonSerialize());
123+
$response->assertFetchedOne($expected);
124124

125125
$this->assertDatabaseHas('posts', [
126126
'author_id' => $this->post->author->getKey(),
@@ -159,7 +159,7 @@ public function testSoftDelete(): void
159159
->withData($data)
160160
->patch(url('/api/v1/posts', $this->post));
161161

162-
$response->assertUpdated($expected->jsonSerialize());
162+
$response->assertFetchedOne($expected);
163163

164164
$this->assertSoftDeleted($this->post);
165165
$this->assertTrue($deleted);
@@ -191,7 +191,7 @@ public function testRestore(): void
191191
->withData($data)
192192
->patch(url('/api/v1/posts', $this->post));
193193

194-
$response->assertUpdated($expected->jsonSerialize());
194+
$response->assertFetchedOne($expected);
195195

196196
$this->assertDatabaseHas('posts', array_merge($this->post->getOriginal(), [
197197
'deleted_at' => null,

0 commit comments

Comments
 (0)