Skip to content

Commit 5d5b186

Browse files
PHPUnit 10 Shift (#37)
1 parent 16d4c3f commit 5d5b186

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/vendor
77
.env
88
.env.backup
9-
.phpunit.result.cache
9+
/.phpunit.cache
1010
Homestead.json
1111
Homestead.yaml
1212
auth.json

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
"name": "laravel-shift/curl-converter",
33
"description": "A command line tool to convert curl requests to Laravel HTTP requests.",
44
"type": "library",
5-
"keywords": ["curl", "converter", "http", "laravel", "shift"],
5+
"keywords": [
6+
"curl",
7+
"converter",
8+
"http",
9+
"laravel",
10+
"shift"
11+
],
612
"license": "MIT",
713
"require": {
814
"php": "^8.3",
@@ -14,7 +20,7 @@
1420
"laravel/pint": "^1.24",
1521
"mockery/mockery": "^1.4.4",
1622
"orchestra/testbench": "^7.0",
17-
"phpunit/phpunit": "^9.5.10"
23+
"phpunit/phpunit": "^10.0"
1824
},
1925
"autoload": {
2026
"psr-4": {

tests/Feature/Console/Commands/CurlCommandTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
namespace Tests\Feature\Console\Commands;
44

5+
use PHPUnit\Framework\Attributes\DataProvider;
6+
use PHPUnit\Framework\Attributes\Test;
57
use Illuminate\Support\Facades\Artisan;
68
use InvalidArgumentException;
79
use 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

Comments
 (0)