8000 [Tests] Fix broken tests due to faker deprecations and PHP 8.2 · mikoop79/laravel-json-api@8694346 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8694346

Browse files
committed
[Tests] Fix broken tests due to faker deprecations and PHP 8.2
1 parent 49bc9f7 commit 8694346

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

tests/dummy/database/factories/ModelFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
/** Image */
7171
$factory->define(DummyApp\Image::class, function (Faker $faker) {
7272
return [
73-
'url' => $faker->imageUrl(),
73+
'url' => $faker->url(),
7474
];
7575
});
7676

tests/lib/Integration/ErrorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public function testCustomInvalidJson()
200200
* whatever error is generated by the application must be returned as a JSON API error
201201
* even if the error has not been generated from one of the configured APIs.
202202
*/
203-
public function testClientWantsJsonApiError()
203+
public function testClientWantsJsonApiError(): void
204204
{
205205
$expected = [
206206
'errors' => [
@@ -218,7 +218,7 @@ public function testClientWantsJsonApiError()
218218
$response
219219
->assertStatus(404)
220220
->assertHeader('Content-Type', 'application/vnd.api+json')
221-
->assertExactJson($expected);
221+
->assertJson($expected);
222222
}
223223

224224
/**

tests/lib/Integration/PackageTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ public function testReadBlog()
5151
/**
5252
* Test that we can read a resource from the application.
5353
*/
54-
public function testReadPost()
54+
public function testReadPost(): void
5555
{
56-
$this->resourceType = 'posts';
57-
5856
/** @var Post $post */
5957
$post = factory(Post::class)->create();
6058

tests/lib/Integration/Validation/QueryValidationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ public function testSearch(array $params, string $param, string $detail)
117117
'source' => ['parameter' => $param],
118118
];
119119

120-
$this->resourceType = 'posts';
121-
122120
$response = $this
123121
->jsonApi('posts')
124122
->query($params)

0 commit comments

Comments
 (0)
0