8000 Use short closure syntax and @group slow · symfony/symfony@ad96b23 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad96b23

Browse files
committed
Use short closure syntax and @group slow
1 parent 07ac058 commit ad96b23

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,9 +1544,7 @@ public function testEnvCaseInsensitiveOnWindows()
15441544
public function testMultipleCallsToProcGetStatus()
15451545
{
15461546
$process = $this->getProcess('echo foo');
1547-
$process->start(function () use ($process) {
1548-
$process->isRunning();
1549-
});
1547+
$process->start(static fn () => $process->isRunning());
15501548
while ($process->isRunning()) {
15511549
usleep(1000);
15521550
}
@@ -1556,39 +1554,33 @@ public function testMultipleCallsToProcGetStatus()
15561554
public function testFailingProcessWithMultipleCallsToProcGetStatus()
15571555
{
15581556
$process = $this->getProcess('exit 123');
1559-
$process->start(function () use ($process) {
1560-
$process->isRunning();
1561-
});
1557+
$process->start(static fn () => $process->isRunning());
15621558
while ($process->isRunning()) {
15631559
usleep(1000);
15641560
}
15651561
$this->assertSame(123, $process->getExitCode());
15661562
}
15671563

15681564
/**
1569-
* @group time-sensitive
1565+
* @group slow
15701566
*/
15711567
public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
15721568
{
15731569
$process = $this->getProcess('sleep 1; echo "done"');
1574-
$process->start(function () use ($process) {
1575-
$process->isRunning();
1576-
});
1570+
$process->start(static fn () => $process->isRunning());
15771571
while ($process->isRunning()) {
15781572
usleep(1000);
15791573
}
15801574
$this->assertSame(0, $process->getExitCode());
15811575
}
15821576

15831577
/**
1584-
* @group time-sensitive
1578+
* @group slow
15851579
*/
15861580
public function testLongRunningProcessWithMultipleCallsToProcGetStatusError()
15871581
{
15881582
$process = $this->getProcess('sleep 1; echo "failure"; exit 123');
1589-
$process->start(function () use ($process) {
1590-
$process->isRunning();
1591-
});
1583+
$process->start(static fn () => $process->isRunning());
15921584
while ($process->isRunning()) {
15931585
usleep(1000);
15941586
}

0 commit comments

Comments
 (0)
0