Skip to content

Commit bcbdb7e

Browse files
committed
Remove deprecated PHPUnit's MockBuilder::setMethods
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
1 parent 44f66f8 commit bcbdb7e

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"phpstan/phpstan": "^0.12.98",
2727
"phpstan/phpstan-phpunit": "^0.12.16",
2828
"phpunit/php-code-coverage": "*",
29-
"phpunit/phpunit": "^7.4 || ^8 || ^9",
29+
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
3030
"psalm/plugin-phpunit": "^0.16.1",
3131
"vimeo/psalm": "^4.10",
3232
"zumba/json-serializer": "^3.0"

tests/Utils/CLITest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CLITest extends TestCase
2121
*/
2222
private function getCLI($getopt)
2323
{
24-
$cli = $this->getMockBuilder(CLI::class)->setMethods(['getopt'])->getMock();
24+
$cli = $this->createPartialMock(CLI::class, ['getopt']);
2525
$cli->method('getopt')->willReturn($getopt);
2626

2727
return $cli;
@@ -35,7 +35,7 @@ private function getCLI($getopt)
3535
*/
3636
private function getCLIStdIn($input, $getopt)
3737
{
38-
$cli = $this->getMockBuilder(CLI::class)->setMethods(['getopt', 'readStdin'])->getMock();
38+
$cli = $this->createPartialMock(CLI::class, ['getopt', 'readStdin']);
3939
$cli->method('getopt')->willReturn($getopt);
4040
$cli->method('readStdin')->willReturn($input);
4141

tests/Utils/FormatterTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class FormatterTest extends TestCase
1919
*/
2020
public function testMergeFormats($default, $overriding, $expected): void
2121
{
22-
$formatter = $this->getMockBuilder(Formatter::class)
23-
->disableOriginalConstructor()
24-
->setMethods(['getDefaultOptions', 'getDefaultFormats'])
25-
->getMock();
22+
$formatter = $this->createPartialMock(Formatter::class, ['getDefaultOptions', 'getDefaultFormats']);
2623

2724
$formatter->expects($this->once())
2825
->method('getDefaultOptions')

0 commit comments

Comments
 (0)