Skip to content

Commit 4962563

Browse files
committed
Migrate to PHPUnit attributes
1 parent acb6b62 commit 4962563

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
->withTypeCoverageLevel(0)
1515
->withDeadCodeLevel(0)
1616
->withCodeQualityLevel(0)
17+
->withAttributesSets(phpunit: true)
1718
->withSets([
1819
\Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_100,
1920
])

tests/E2E/TerminateCommandTest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ class TerminateCommandTest extends TestCase
1717
private const STUB_COMMAND = 'stub:terminable:sleep';
1818

1919
/**
20-
* @dataProvider commandLineProvider
21-
*
2220
* @param string[] $commandLine
2321
*/
22+
#[\PHPUnit\Framework\Attributes\DataProvider('commandLineProvider')]
2423
public function testStubCommand(array $commandLine): void
2524
{
2625
$process = new Process($commandLine);
@@ -58,9 +57,7 @@ public static function commandLineProvider(): array
5857
];
5958
}
6059

61-
/**
62-
* @dataProvider provideSignals
63-
*/
60+
#[\PHPUnit\Framework\Attributes\DataProvider('provideSignals')]
6461
public function testSignalsDuringCommandBody(int $signal, int $exitCode): void
6562
{
6663
$process = new Process([
@@ -87,9 +84,7 @@ public function testSignalsDuringCommandBody(int $signal, int $exitCode): void
8784
$this->assertSame($exitCode, $process->getExitCode());
8885
}
8986

90-
/**
91-
* @dataProvider provideSignals
92-
*/
87+
#[\PHPUnit\Framework\Attributes\DataProvider('provideSignals')]
9388
public function testSigTermDuringSleep(int $signal, int $exitCode): void
9489
{
9590
$process = new Process([

tests/Unit/AbstractTerminableCommandTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
7878
$stubCommand->run(new ArrayInput([]), $output->reveal());
7979
}
8080

81-
/**
82-
* @dataProvider signalProvider
83-
*/
81+
#[\PHPUnit\Framework\Attributes\DataProvider('signalProvider')]
8482
public function testReceiveSignalDuringCommandBody(int $signal): void
8583
{
8684
$stubCommand = new class ($signal) extends AbstractTerminableCommand {
@@ -112,9 +110,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
112110
$this->assertSame(143, $exitCode);
113111
}
114112

115-
/**
116-
* @dataProvider signalProvider
117-
*/
113+
#[\PHPUnit\Framework\Attributes\DataProvider('signalProvider')]
118114
public function testReceiveSignalBeforeCommandBody(int $signal): void
119115
{
120116
$stubCommand = $this->createStubTerminableCommand();
@@ -133,9 +129,7 @@ public function testReceiveSignalBeforeCommandBody(int $signal): void
133129
$this->assertSame(143, $exitCode);
134130
}
135131

136-
/**
137-
* @dataProvider signalProvider
138-
*/
132+
#[\PHPUnit\Framework\Attributes\DataProvider('signalProvider')]
139133
public function testGetSubscribedSignals(int $signal): void
140134
{
141135
$stubCommand = $this->createStubTerminableCommand();

0 commit comments

Comments
 (0)