Skip to content

Commit 27fb64f

Browse files
committed
Upgrade PHPUnit
1 parent 73ead05 commit 27fb64f

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"phpstan/extension-installer": "^1.0",
4141
"phpstan/phpstan": "^0.12.55",
4242
"phpstan/phpstan-phpunit": "^0.12.16",
43-
"phpunit/phpunit": "^8.5.14 | ^9.5.2",
43+
"phpunit/phpunit": "^9.6.6",
4444
"phpspec/prophecy-phpunit": "^2.0",
4545
"symfony/phpunit-bridge": "^5.2",
4646
"vimeo/psalm": "^4.6"

phpunit.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
executionOrder="depends,defects"
66
cacheResult="false"
77
colors="true"
88
beStrictAboutOutputDuringTests="true"
99
beStrictAboutTodoAnnotatedTests="true"
1010
verbose="true">
11-
<testsuites>
12-
<testsuite name="default">
13-
<directory suffix="Test.php">tests</directory>
14-
</testsuite>
15-
</testsuites>
11+
<testsuites>
12+
<testsuite name="default">
13+
<directory suffix="Test.php">tests</directory>
14+
</testsuite>
15+
</testsuites>
1616

17-
<filter>
18-
<whitelist processUncoveredFilesFromWhitelist="true">
19-
<directory suffix=".php">src</directory>
20-
</whitelist>
21-
</filter>
17+
<coverage processUncoveredFiles="true">
18+
<include>
19+
<directory suffix=".php">src</directory>
20+
</include>
21+
</coverage>
2222
</phpunit>

tests/E2E/TerminateCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testSigTermDuringSleep(): void
106106
$this->assertCommandIsFound($process);
107107
$this->assertStringContainsString('Starting ' . self::STUB_COMMAND, $process->getOutput());
108108
$this->assertStringNotContainsString('Signal received, skipping execution', $process->getOutput());
109-
$this->assertRegExp('/Slept (0|1) second\(s\)/', $process->getOutput());
109+
$this->assertMatchesRegularExpression('/Slept (0|1) second\(s\)/', $process->getOutput());
110110
$this->assertSame(143, $process->getExitCode());
111111
}
112112

tests/Unit/AbstractTerminableCommandTest.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Prophecy\Argument;
1010
use Prophecy\PhpUnit\ProphecyTrait;
1111
use Symfony\Bridge\PhpUnit\ClockMock;
12+
use Symfony\Component\Console\Input\ArrayInput;
1213
use Symfony\Component\Console\Input\InputInterface;
1314
use Symfony\Component\Console\Output\OutputInterface;
1415

@@ -39,7 +40,6 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
3940
}
4041
};
4142

42-
$input = $this->prophesize(InputInterface::class);
4343
$output = $this->prophesize(OutputInterface::class);
4444
$output->writeln(Argument::containingString('Starting'), OutputInterface::VERBOSITY_VERBOSE)
4545
->shouldBeCalledTimes(1);
@@ -50,7 +50,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
5050

5151
ClockMock::withClockMock(true);
5252
$start = ClockMock::time();
53-
$exitCode = $stubCommand->run($input->reveal(), $output->reveal());
53+
$exitCode = $stubCommand->run(new ArrayInput([]), $output->reveal());
5454
$end = ClockMock::time();
5555

5656
$this->assertSame(0, $exitCode);
@@ -69,14 +69,13 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
6969
}
7070
};
7171

72-
$input = $this->prophesize(InputInterface::class);
7372
$output = $this->prophesize(OutputInterface::class);
7473
$output->writeln(Argument::containingString('Starting'), OutputInterface::VERBOSITY_VERBOSE)
7574
->shouldBeCalledTimes(1);
7675

7776
$this->expectException(\InvalidArgumentException::class);
7877

79-
$stubCommand->run($input->reveal(), $output->reveal());
78+
$stubCommand->run(new ArrayInput([]), $output->reveal());
8079
}
8180

8281
/**
@@ -102,14 +101,13 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
102101
}
103102
};
104103

105-
$input = $this->prophesize(InputInterface::class);
106104
$output = $this->prophesize(OutputInterface::class);
107105
$output->writeln(Argument::containingString('Starting'), OutputInterface::VERBOSITY_VERBOSE)
108106
->shouldBeCalledTimes(1);
109107
$output->writeln('Signal received, terminating with exit code 143', OutputInterface::VERBOSITY_NORMAL)
110108
->shouldBeCalledTimes(1);
111109

112-
$exitCode = $stubCommand->run($input->reveal(), $output->reveal());
110+
$exitCode = $stubCommand->run(new ArrayInput([]), $output->reveal());
113111

114112
$this->assertSame(143, $exitCode);
115113
}
@@ -126,7 +124,6 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
126124
}
127125
};
128126

129-
$input = $this->prophesize(InputInterface::class);
130127
$output = $this->prophesize(OutputInterface::class);
131128
$output->writeln(Argument::containingString('Starting'), OutputInterface::VERBOSITY_VERBOSE)
132129
->shouldBeCalledTimes(1)
@@ -136,7 +133,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
136133
$output->writeln('Signal received, skipping execution', OutputInterface::VERBOSITY_NORMAL)
137134
->shouldBeCalledTimes(1);
138135

139-
$exitCode = $stubCommand->run($input->reveal(), $output->reveal());
136+
$exitCode = $stubCommand->run(new ArrayInput([]), $output->reveal());
140137

141138
$this->assertSame(143, $exitCode);
142139
}

0 commit comments

Comments
 (0)