Skip to content

Commit ad4f972

Browse files
author
Jigar Dhulla
committed
Update PHPUnit configuration and refactor test annotations to attributes
1 parent 6e9d925 commit ad4f972

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

phpunit.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?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">
83
<testsuites>
94
<testsuite name="Test Suite">
105
<directory>tests</directory>
116
</testsuite>
127
</testsuites>
13-
</phpunit>
8+
<source>
9+
<include>
10+
<directory suffix=".php">src/</directory>
11+
</include>
12+
</source>
13+
</phpunit>

tests/CurlCommandLineGeneratorTest.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,28 @@
55
use GuzzleHttp\Psr7\Request as Psr7Request;
66
use Illuminate\Http\Client\Request;
77
use jigarakatidus\HttpToCurl\CurlCommandLineGenerator;
8+
use PHPUnit\Framework\Attributes\Test;
89
use PHPUnit\Framework\TestCase;
910

1011
class CurlCommandLineGeneratorTest extends TestCase
1112
{
12-
/**
13-
* @test
14-
*
15-
* @return void
16-
*/
13+
#[Test]
1714
public function it_should_return_get_command(): void
1815
{
1916
$command = CurlCommandLineGenerator::generate(new Request(new Psr7Request('get', 'https://example.com')));
2017

2118
$this->assertEquals($command, "curl -H 'Host: example.com' -X 'GET' 'https://example.com'");
2219
}
2320

24-
/**
25-
* @test
26-
*
27-
* @return void
28-
*/
21+
#[Test]
2922
public function it_should_return_get_command_with_parameters(): void
3023
{
3124
$command = CurlCommandLineGenerator::generate(new Request(new Psr7Request('get', 'https://example.com?foo=bar')));
3225

3326
$this->assertEquals($command, "curl -H 'Host: example.com' -X 'GET' 'https://example.com?foo=bar'");
3427
}
3528

36-
/**
37-
* @test
38-
*
39-
* @return void
40-
*/
29+
#[Test]
4130
public function it_should_return_post_command_with_form_body(): void
4231
{
4332
$psr7Request = new Psr7Request(
@@ -57,11 +46,7 @@ public function it_should_return_post_command_with_form_body(): void
5746
);
5847
}
5948

60-
/**
61-
* @test
62-
*
63-
* @return void
64-
*/
49+
#[Test]
6550
public function it_should_return_post_command_with_json_body(): void
6651
{
6752
$psr7Request = new Psr7Request(

0 commit comments

Comments
 (0)