File tree Expand file tree Collapse file tree 2 files changed +12
-27
lines changed Expand file tree Collapse file tree 2 files changed +12
-27
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" bootstrap =" vendor/autoload.php" backupGlobals =" false" backupStaticAttributes =" false" colors =" true" verbose =" true" convertErrorsToExceptions =" true" convertNoticesToExceptions =" true" convertWarningsToExceptions =" true" processIsolation =" false" stopOnFailure =" false" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd" >
3
- <coverage >
4
- <include >
5
- <directory suffix =" .php" >src/</directory >
6
- </include >
7
- </coverage >
2
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" bootstrap =" vendor/autoload.php" backupGlobals =" false" colors =" true" processIsolation =" false" stopOnFailure =" false" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/11.5/phpunit.xsd" cacheDirectory =" .phpunit.cache" backupStaticProperties =" false" >
8
3
<testsuites >
9
4
<testsuite name =" Test Suite" >
10
5
<directory >tests</directory >
11
6
</testsuite >
12
7
</testsuites >
13
- </phpunit >
8
+ <source >
9
+ <include >
10
+ <directory suffix =" .php" >src/</directory >
11
+ </include >
12
+ </source >
13
+ </phpunit >
Original file line number Diff line number Diff line change 5
5
use GuzzleHttp \Psr7 \Request as Psr7Request ;
6
6
use Illuminate \Http \Client \Request ;
7
7
use jigarakatidus \HttpToCurl \CurlCommandLineGenerator ;
8
+ use PHPUnit \Framework \Attributes \Test ;
8
9
use PHPUnit \Framework \TestCase ;
9
10
10
11
class CurlCommandLineGeneratorTest extends TestCase
11
12
{
12
- /**
13
- * @test
14
- *
15
- * @return void
16
- */
13
+ #[Test]
17
14
public function it_should_return_get_command (): void
18
15
{
19
16
$ command = CurlCommandLineGenerator::generate (new Request (new Psr7Request ('get ' , 'https://example.com ' )));
20
17
21
18
$ this ->assertEquals ($ command , "curl -H 'Host: example.com' -X 'GET' 'https://example.com' " );
22
19
}
23
20
24
- /**
25
- * @test
26
- *
27
- * @return void
28
- */
21
+ #[Test]
29
22
public function it_should_return_get_command_with_parameters (): void
30
23
{
31
24
$ command = CurlCommandLineGenerator::generate (new Request (new Psr7Request ('get ' , 'https://example.com?foo=bar ' )));
32
25
33
26
$ this ->assertEquals ($ command , "curl -H 'Host: example.com' -X 'GET' 'https://example.com?foo=bar' " );
34
27
}
35
28
36
- /**
37
- * @test
38
- *
39
- * @return void
40
- */
29
+ #[Test]
41
30
public function it_should_return_post_command_with_form_body (): void
42
31
{
43
32
$ psr7Request = new Psr7Request (
@@ -57,11 +46,7 @@ public function it_should_return_post_command_with_form_body(): void
57
46
);
58
47
}
59
48
60
- /**
61
- * @test
62
- *
63
- * @return void
64
- */
49
+ #[Test]
65
50
public function it_should_return_post_command_with_json_body (): void
66
51
{
67
52
$ psr7Request = new Psr7Request (
You can’t perform that action at this time.
0 commit comments