Skip to content

Commit d1988a2

Browse files
committed
refactor: add typ hint for test case method
1 parent ed1cfc0 commit d1988a2

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

tests/SwaggerServiceTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,6 @@ public function testAddDataWhenInvokableClass()
942942
{
943943
$this->mockDriverGetEmptyAndSaveProcessTmpData($this->getJsonFixture('tmp_data_get_user_request_invoke'));
944944

945-
$service = app(SwaggerService::class);
946-
947945
$request = $this->generateRequest(
948946
type: 'get',
949947
uri: 'users',
@@ -954,6 +952,6 @@ public function testAddDataWhenInvokableClass()
954952
'Content-type' => 'application/json',
955953
]);
956954

957-
$service->addData($request, $response);
955+
app(SwaggerService::class)->addData($request, $response);
958956
}
959957
}

tests/TestCase.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Orchestra\Testbench\TestCase as BaseTest;
1212
use RonasIT\AutoDoc\AutoDocServiceProvider;
1313
use RonasIT\AutoDoc\Tests\Support\Mock\TestController;
14-
use RonasIT\AutoDoc\Tests\Support\Mock\TestInvokableController;
1514
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
1615
use Symfony\Component\HttpFoundation\Response;
1716

@@ -117,13 +116,13 @@ protected function clearDirectory($dirPath, $exceptPaths = []): void
117116
}
118117

119118
protected function generateRequest(
120-
$type,
121-
$uri,
122-
$data = [],
123-
$pathParams = [],
124-
$headers = [],
125-
$routeConditions = [],
126-
$controllerMethod = 'test',
119+
string $type,
120+
string $uri,
121+
array $data = [],
122+
array $pathParams = [],
123+
array $headers = [],
124+
array $routeConditions = [],
125+
string $controllerMethod = 'test',
127126
): Request {
128127
$request = $this->getBaseRequest($type, $uri, $data, $pathParams, $headers);
129128

0 commit comments

Comments
 (0)