22
33namespace Tests \Feature \Console \Commands ;
44
5+ use PHPUnit \Framework \Attributes \DataProvider ;
6+ use PHPUnit \Framework \Attributes \Test ;
57use Illuminate \Support \Facades \Artisan ;
68use InvalidArgumentException ;
79use Tests \TestCase ;
810
9- class CurlCommandTest extends TestCase
11+ final class CurlCommandTest extends TestCase
1012{
11- /**
12- * @test
13- * @dataProvider curlCommandFixtures
14- */
15- public function it_converts_curl_requests_to_http_client_code ($ fixture )
13+ #[Test]
14+ #[DataProvider('curlCommandFixtures ' )]
15+ public function it_converts_curl_requests_to_http_client_code ($ fixture ): void
1616 {
1717 $ code = Artisan::call ('shift: ' . $ this ->fixture ($ fixture . '.in ' ));
1818 $ output = trim (Artisan::output ());
@@ -21,23 +21,23 @@ public function it_converts_curl_requests_to_http_client_code($fixture)
2121 $ this ->assertSame ($ this ->fixture ($ fixture . '.out ' ), $ output );
2222 }
2323
24- public function test_it_throw_exception_when_for_invalid_url ()
24+ public function test_it_throw_exception_when_for_invalid_url (): void
2525 {
2626 $ this ->expectException (InvalidArgumentException::class);
2727 $ this ->expectExceptionMessage ('The "https://{domain:port}/api/{id}/" URL is invalid. ' );
2828
2929 Artisan::call ('shift:curl -X GET "https://{domain:port}/api/{id}/" ' );
3030 }
3131
32- public function test_it_throw_exception_when_for_invalid_headers ()
32+ public function test_it_throw_exception_when_for_invalid_headers (): void
3333 {
3434 $ this ->expectException (InvalidArgumentException::class);
3535 $ this ->expectExceptionMessage ('The "foo" header must be a key/value pair separated by ":". ' );
3636
3737 Artisan::call ("shift:curl https://example.com --header 'foo' " );
3838 }
3939
40- public function curlCommandFixtures ()
40+ public static function curlCommandFixtures (): array
4141 {
4242 return [
4343 'GET request ' => ['basic-get ' ],
0 commit comments