Skip to content

Commit 45ee94a

Browse files
Bumps phpunit to 10.x (#5802)
Co-authored-by: 李铭昕 <[email protected]>
1 parent a58200a commit 45ee94a

File tree

7 files changed

+17
-5
lines changed

7 files changed

+17
-5
lines changed

tests/MessageTraitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
use Hyperf\HttpMessage\Base\Request;
1515
use Hyperf\HttpMessage\Server\Request as ServerRequest;
16+
use PHPUnit\Framework\Attributes\CoversNothing;
1617
use PHPUnit\Framework\TestCase;
1718

1819
/**
1920
* @internal
2021
* @coversNothing
2122
*/
23+
#[CoversNothing]
2224
class MessageTraitTest extends TestCase
2325
{
2426
public function testSetHeaders()

tests/RequestParserTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
use Hyperf\HttpMessage\Exception\BadRequestHttpException;
1515
use Hyperf\HttpMessage\Server\Request\JsonParser;
1616
use Hyperf\HttpMessage\Server\Request\XmlParser;
17+
use PHPUnit\Framework\Attributes\CoversNothing;
1718
use PHPUnit\Framework\TestCase;
1819

1920
/**
2021
* @internal
2122
* @coversNothing
2223
*/
24+
#[CoversNothing]
2325
class RequestParserTest extends TestCase
2426
{
2527
public function testJsonParserFailed()

tests/ResponseProxyTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313

1414
use Hyperf\HttpMessage\Server\Response;
1515
use HyperfTest\HttpMessage\Stub\Server\ResponseStub;
16+
use PHPUnit\Framework\Attributes\CoversNothing;
1617

1718
/**
1819
* @internal
1920
* @coversNothing
2021
*/
22+
#[CoversNothing]
2123
class ResponseProxyTest extends ResponseTest
2224
{
2325
protected function tearDown(): void

tests/ResponseTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
use Hyperf\HttpMessage\Server\Connection\SwooleConnection;
1616
use Hyperf\HttpMessage\Server\Response;
1717
use Mockery;
18+
use PHPUnit\Framework\Attributes\CoversNothing;
1819
use PHPUnit\Framework\TestCase;
1920
use Swoole\Http\Response as SwooleResponse;
2021

2122
/**
2223
* @internal
2324
* @coversNothing
2425
*/
26+
#[CoversNothing]
2527
class ResponseTest extends TestCase
2628
{
2729
protected function tearDown(): void

tests/ServerRequestTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use HyperfTest\HttpMessage\Stub\Server\RequestStub;
2525
use InvalidArgumentException;
2626
use Mockery;
27+
use PHPUnit\Framework\Attributes\CoversNothing;
2728
use PHPUnit\Framework\TestCase;
2829
use Psr\Container\ContainerInterface;
2930
use Psr\Http\Message\RequestInterface;
@@ -34,6 +35,7 @@
3435
* @internal
3536
* @coversNothing
3637
*/
38+
#[CoversNothing]
3739
class ServerRequestTest extends TestCase
3840
{
3941
protected function tearDown(): void
@@ -157,9 +159,7 @@ public function testGetUriFromGlobals()
157159
$this->assertSame(null, $uri->getPort());
158160
}
159161

160-
/**
161-
* @group ParseHost
162-
*/
162+
#[\PHPUnit\Framework\Attributes\Group('ParseHost')]
163163
public function testParseHost()
164164
{
165165
$hostStrIPv4 = '192.168.119.100:9501';
@@ -182,11 +182,11 @@ public function testParseHost()
182182
}
183183

184184
/**
185-
* @dataProvider getIPv6Examples
186185
* @param mixed $originHost
187186
* @param mixed $host
188187
* @param mixed $port
189188
*/
189+
#[\PHPUnit\Framework\Attributes\DataProvider('getIPv6Examples')]
190190
public function testGetUriFromGlobalsForIPv6Host($originHost, $host, $port)
191191
{
192192
$swooleRequest = Mockery::mock(SwooleRequest::class);
@@ -211,7 +211,7 @@ public function testGetUriFromGlobalsForIPv6Host($originHost, $host, $port)
211211
$this->assertSame($host, $uri->getHost());
212212
}
213213

214-
public function getIPv6Examples(): array
214+
public static function getIPv6Examples(): array
215215
{
216216
return [
217217
['localhost:9501', 'localhost', 9501],

tests/SwooleStreamTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
use Hyperf\HttpMessage\Stream\SwooleStream;
1717
use Hyperf\HttpServer\ResponseEmitter;
1818
use Mockery;
19+
use PHPUnit\Framework\Attributes\CoversNothing;
1920
use PHPUnit\Framework\TestCase;
2021
use Swoole\Http\Response as SwooleResponse;
2122

2223
/**
2324
* @internal
2425
* @coversNothing
2526
*/
27+
#[CoversNothing]
2628
class SwooleStreamTest extends TestCase
2729
{
2830
public function testSwooleFileStream()

tests/Upload/UploadedFileTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
use Hyperf\HttpMessage\Upload\UploadedFile;
1515
use Mockery;
16+
use PHPUnit\Framework\Attributes\CoversNothing;
1617
use PHPUnit\Framework\TestCase;
1718

1819
/**
1920
* @internal
2021
* @coversNothing
2122
*/
23+
#[CoversNothing]
2224
class UploadedFileTest extends TestCase
2325
{
2426
protected function tearDown(): void

0 commit comments

Comments
 (0)