Skip to content

Commit d59d245

Browse files
committed
Tweet response structure update
1 parent 7f4511f commit d59d245

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

backend/tests/Feature/Api/ApiTestCase.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
1010
use Illuminate\Foundation\Testing\RefreshDatabase;
1111
use Illuminate\Contracts\Auth\Authenticatable;
12+
use Illuminate\Foundation\Testing\TestResponse;
1213
use Illuminate\Support\Facades\Auth;
14+
use InvalidArgumentException;
1315
use Tests\CreatesApplication;
1416

1517
abstract class ApiTestCase extends BaseTestCase
@@ -43,7 +45,8 @@ abstract class ApiTestCase extends BaseTestCase
4345
'id',
4446
'text',
4547
'image_url',
46-
'author' => self::USER_RESOURCE_STRUCTURE
48+
'author' => self::USER_RESOURCE_STRUCTURE,
49+
'comments_count'
4750
];
4851

4952
/**
@@ -91,7 +94,7 @@ protected function seedFakeData(int $itemsAmount = 5): void
9194
* @param array $files
9295
* @param array $server
9396
* @param null $content
94-
* @return \Illuminate\Foundation\Testing\TestResponse
97+
* @return TestResponse
9598
*/
9699
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
97100
{
@@ -121,7 +124,7 @@ protected function actingWithToken(Authenticatable $user = null): self
121124
private function assertUriIsValid(string $uri): void
122125
{
123126
if (empty($uri)) {
124-
throw new \InvalidArgumentException('Request URI cannot be empty.');
127+
throw new InvalidArgumentException('Request URI cannot be empty.');
125128
}
126129
}
127130

@@ -240,7 +243,7 @@ protected function createResourceItemUri(string $uri, int $id): string
240243
private function assertAttributesIsValid(array $attributes): void
241244
{
242245
if (empty($attributes)) {
243-
throw new \InvalidArgumentException('Request attributes are empty.');
246+
throw new InvalidArgumentException('Request attributes are empty.');
244247
}
245248
}
246249
}

0 commit comments

Comments
 (0)