Skip to content

Commit 6f8c17f

Browse files
committed
PHPUnit 9.6 => 11.x
1 parent 3e3edad commit 6f8c17f

File tree

7 files changed

+25
-29
lines changed

7 files changed

+25
-29
lines changed

.phpunit.cache/test-results

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":{"Imunew\\Pipeline\\Test\\Context\\ContextTest::setStatus":8},"times":{"Imunew\\Pipeline\\Test\\Context\\StatusTest::isInitialized":0,"Imunew\\Pipeline\\Test\\Context\\StatusTest::isStarted":0,"Imunew\\Pipeline\\Test\\Context\\StatusTest::isStopped":0,"Imunew\\Pipeline\\Test\\Pipe\\PipesTest::mergeNumberPipes":0,"Imunew\\Pipeline\\Test\\PipelineTest::processSuccessWithIncrementNumberPipes":0,"Imunew\\Pipeline\\Test\\PipelineTest::processSuccessWithMessagePipes":0,"Imunew\\Pipeline\\Test\\PipelineTest::processSuccessWithExtraMessagePipes":0,"Imunew\\Pipeline\\Test\\PipelineTest::processFailedByNotReturnContext":0.001,"Imunew\\Pipeline\\Test\\Context\\ContextTest::setStatus":0.004,"Imunew\\Pipeline\\Test\\Context\\ContextTest::setStatus#0":0.001,"Imunew\\Pipeline\\Test\\Context\\ContextTest::setStatus#1":0,"Imunew\\Pipeline\\Test\\Context\\ContextTest::setStatus#2":0}}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php": ">=8.1"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^9.6",
26+
"phpunit/phpunit": "^11.0",
2727
"phpstan/phpstan": "^1.10"
2828
}
2929
}

phpunit.xml.dist

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" verbose="true">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">src</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.1/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" cacheDirectory=".phpunit.cache">
83
<testsuite name="tests">
94
<directory suffix="Test.php">tests</directory>
105
</testsuite>
6+
<source>
7+
<include>
8+
<directory suffix=".php">src</directory>
9+
</include>
10+
</source>
1111
</phpunit>

tests/Context/ContextTest.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use Imunew\Pipeline\Context\Context;
55
use Imunew\Pipeline\Context\ContextInterface;
66
use Imunew\Pipeline\Context\Status;
7+
use PHPUnit\Framework\Attributes\DataProvider;
8+
use PHPUnit\Framework\Attributes\Test;
79
use PHPUnit\Framework\TestCase;
810

911
/**
@@ -13,16 +15,15 @@
1315
class ContextTest extends TestCase
1416
{
1517
/**
16-
* @test
17-
* @dataProvider getTestStatus
18-
*
1918
* @param ContextInterface $context
2019
* @param bool $isInitialized
2120
* @param bool $isStarted
2221
* @param bool $isStopped
2322
*
2423
* @return void
2524
*/
25+
#[Test]
26+
#[DataProvider('getTestStatus')]
2627
public function setStatus($context, $isInitialized, $isStarted, $isStopped)
2728
{
2829
$this->assertSame($isInitialized, $context->isInitialized());
@@ -33,7 +34,7 @@ public function setStatus($context, $isInitialized, $isStarted, $isStopped)
3334
/**
3435
* @return array<string, mixed>[]
3536
*/
36-
public function getTestStatus()
37+
public static function getTestStatus()
3738
{
3839
$context = new Context();
3940

tests/Context/StatusTest.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
namespace Imunew\Pipeline\Test\Context;
33

44
use Imunew\Pipeline\Context\Status;
5+
use PHPUnit\Framework\Attributes\Test;
56
use PHPUnit\Framework\TestCase;
67

78
class StatusTest extends TestCase
89
{
910
/**
10-
* @test
11-
*
1211
* @return void
1312
*/
13+
#[Test]
1414
public function isInitialized()
1515
{
1616
$status = Status::initialize();
@@ -21,10 +21,9 @@ public function isInitialized()
2121
}
2222

2323
/**
24-
* @test
25-
*
2624
* @return void
2725
*/
26+
#[Test]
2827
public function isStarted()
2928
{
3029
$status = Status::start();
@@ -35,10 +34,9 @@ public function isStarted()
3534
}
3635

3736
/**
38-
* @test
39-
*
4037
* @return void
4138
*/
39+
#[Test]
4240
public function isStopped()
4341
{
4442
$status = Status::stop();

tests/Pipe/PipesTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Imunew\Pipeline\Context\ContextInterface;
66
use Imunew\Pipeline\Pipe\Pipes;
77
use Imunew\Pipeline\Pipeline;
8+
use PHPUnit\Framework\Attributes\Test;
89
use PHPUnit\Framework\TestCase;
910

1011
/**
@@ -14,10 +15,9 @@
1415
class PipesTest extends TestCase
1516
{
1617
/**
17-
* @test
18-
*
1918
* @return void
2019
*/
20+
#[Test]
2121
public function mergeNumberPipes()
2222
{
2323
$pipesA = (new Pipes())

tests/PipelineTest.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Imunew\Pipeline\Pipe\PipesInterface;
1010
use Imunew\Pipeline\Pipeline;
1111
use Imunew\Pipeline\Test\Pipe\IncrementNumberPipe;
12+
use PHPUnit\Framework\Attributes\Test;
1213
use PHPUnit\Framework\TestCase;
1314
use RuntimeException;
1415

@@ -19,10 +20,9 @@
1920
class PipelineTest extends TestCase
2021
{
2122
/**
22-
* @test
23-
*
2423
* @return void
2524
*/
25+
#[Test]
2626
public function processSuccessWithIncrementNumberPipes()
2727
{
2828
$pipes = new Pipes();
@@ -40,10 +40,9 @@ public function processSuccessWithIncrementNumberPipes()
4040
}
4141

4242
/**
43-
* @test
44-
*
4543
* @return void
4644
*/
45+
#[Test]
4746
public function processSuccessWithMessagePipes()
4847
{
4948
$messages = ['This', ' is', ' the', ' open-source', ' library.'];
@@ -56,10 +55,9 @@ public function processSuccessWithMessagePipes()
5655
}
5756

5857
/**
59-
* @test
60-
*
6158
* @return void
6259
*/
60+
#[Test]
6361
public function processSuccessWithExtraMessagePipes()
6462
{
6563
$messages = ['This', ' is', ' the', ' open-source', ' library.'];
@@ -77,10 +75,9 @@ public function processSuccessWithExtraMessagePipes()
7775
}
7876

7977
/**
80-
* @test
81-
*
8278
* @return void
8379
*/
80+
#[Test]
8481
public function processFailedByNotReturnContext()
8582
{
8683
$this->expectException(RuntimeException::class);
@@ -91,11 +88,10 @@ public function processFailedByNotReturnContext()
9188
}
9289

9390
/**
94-
* @test
95-
*
9691
* @param array<string> $messages
9792
* @return Pipes|PipesInterface
9893
*/
94+
#[Test]
9995
private function createPipesWithMessages(array $messages)
10096
{
10197
$pipes = new Pipes();

0 commit comments

Comments
 (0)