Skip to content

Commit 20a5bf2

Browse files
committed
Pest upgraded to v2.0
1 parent bf3d090 commit 20a5bf2

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@
3333
"laravel/pint": "^1.2",
3434
"mockery/mockery": "^1.5.1",
3535
"nunomaduro/larastan": "^2.0",
36-
"orchestra/testbench": "^7.0",
37-
"pestphp/pest": "^1.22",
38-
"pestphp/pest-plugin-mock": "^1.0",
39-
"phpunit/phpunit": "^9.0",
36+
"orchestra/testbench": "^v8.0.0",
37+
"pestphp/pest": "^2.0",
38+
"pestphp/pest-plugin-mock": "^2.0",
4039
"squizlabs/php_codesniffer": "^3.7"
4140
},
4241
"autoload": {
@@ -50,8 +49,8 @@
5049
}
5150
},
5251
"scripts": {
53-
"test": "vendor/bin/phpunit",
54-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
52+
"test": "vendor/bin/pest",
53+
"test-coverage": "XDEBUG_MODE=coverage ./vendor/bin/pest --coverage"
5554
},
5655
"config": {
5756
"sort-packages": true,

phpunit.xml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
>
7-
<testsuites>
8-
<testsuite name="Test Suite">
9-
<directory suffix="Test.php">./tests</directory>
10-
</testsuite>
11-
</testsuites>
12-
<coverage processUncoveredFiles="true">
13-
<include>
14-
<directory suffix=".php">./app</directory>
15-
<directory suffix=".php">./src</directory>
16-
</include>
17-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="Test Suite">
5+
<directory suffix="Test.php">./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<coverage>
9+
<include>
10+
<directory suffix=".php">./app</directory>
11+
<directory suffix=".php">./src</directory>
12+
</include>
13+
</coverage>
1814
</phpunit>

tests/Unit/Traits/WithPipelineTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
->method('isDecorated')
1414
->willReturn(true);
1515

16+
$writeIndex = 0;
17+
$expectedOutputs = [
18+
' <bg=blue;fg=white> HOOK </> '.$hook->getName().': <comment>loading...</comment>',
19+
"\x0D",
20+
"\x1B[2K"
21+
];
1622
$outputMock->expects($this->exactly(3))
1723
->method('write')
18-
->withConsecutive(
19-
[$this->equalTo(' <bg=blue;fg=white> HOOK </> '.$hook->getName().': <comment>loading...</comment>')],
20-
[$this->equalTo("\x0D")],
21-
[$this->equalTo("\x1B[2K")]
22-
);
24+
->willReturnCallback(function ($output) use (&$writeIndex, $expectedOutputs) {
25+
$this->assertSame($expectedOutputs[$writeIndex], $output);
26+
$writeIndex++;
27+
});
2328

2429
$outputMock->expects($this->once())
2530
->method('writeln')

0 commit comments

Comments
 (0)