|
9 | 9 | use Illuminate\Foundation\Testing\TestCase as BaseTestCase; |
10 | 10 | use Illuminate\Foundation\Testing\RefreshDatabase; |
11 | 11 | use Illuminate\Contracts\Auth\Authenticatable; |
| 12 | +use Illuminate\Foundation\Testing\TestResponse; |
12 | 13 | use Illuminate\Support\Facades\Auth; |
| 14 | +use InvalidArgumentException; |
13 | 15 | use Tests\CreatesApplication; |
14 | 16 |
|
15 | 17 | abstract class ApiTestCase extends BaseTestCase |
@@ -43,7 +45,8 @@ abstract class ApiTestCase extends BaseTestCase |
43 | 45 | 'id', |
44 | 46 | 'text', |
45 | 47 | 'image_url', |
46 | | - 'author' => self::USER_RESOURCE_STRUCTURE |
| 48 | + 'author' => self::USER_RESOURCE_STRUCTURE, |
| 49 | + 'comments_count' |
47 | 50 | ]; |
48 | 51 |
|
49 | 52 | /** |
@@ -91,7 +94,7 @@ protected function seedFakeData(int $itemsAmount = 5): void |
91 | 94 | * @param array $files |
92 | 95 | * @param array $server |
93 | 96 | * @param null $content |
94 | | - * @return \Illuminate\Foundation\Testing\TestResponse |
| 97 | + * @return TestResponse |
95 | 98 | */ |
96 | 99 | public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null) |
97 | 100 | { |
@@ -121,7 +124,7 @@ protected function actingWithToken(Authenticatable $user = null): self |
121 | 124 | private function assertUriIsValid(string $uri): void |
122 | 125 | { |
123 | 126 | if (empty($uri)) { |
124 | | - throw new \InvalidArgumentException('Request URI cannot be empty.'); |
| 127 | + throw new InvalidArgumentException('Request URI cannot be empty.'); |
125 | 128 | } |
126 | 129 | } |
127 | 130 |
|
@@ -240,7 +243,7 @@ protected function createResourceItemUri(string $uri, int $id): string |
240 | 243 | private function assertAttributesIsValid(array $attributes): void |
241 | 244 | { |
242 | 245 | if (empty($attributes)) { |
243 | | - throw new \InvalidArgumentException('Request attributes are empty.'); |
| 246 | + throw new InvalidArgumentException('Request attributes are empty.'); |
244 | 247 | } |
245 | 248 | } |
246 | 249 | } |
0 commit comments