File tree Expand file tree Collapse file tree 3 files changed +27
-27
lines changed Expand file tree Collapse file tree 3 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 33
33
"laravel/pint" : " ^1.2" ,
34
34
"mockery/mockery" : " ^1.5.1" ,
35
35
"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" ,
40
39
"squizlabs/php_codesniffer" : " ^3.7"
41
40
},
42
41
"autoload" : {
50
49
}
51
50
},
52
51
"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"
55
54
},
56
55
"config" : {
57
56
"sort-packages" : true ,
Original file line number Diff line number Diff line change 1
1
<?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 >
18
14
</phpunit >
Original file line number Diff line number Diff line change 13
13
->method ('isDecorated ' )
14
14
->willReturn (true );
15
15
16
+ $ writeIndex = 0 ;
17
+ $ expectedOutputs = [
18
+ ' <bg=blue;fg=white> HOOK </> ' .$ hook ->getName ().': <comment>loading...</comment> ' ,
19
+ "\x0D" ,
20
+ "\x1B[2K "
21
+ ];
16
22
$ outputMock ->expects ($ this ->exactly (3 ))
17
23
->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
+ });
23
28
24
29
$ outputMock ->expects ($ this ->once ())
25
30
->method ('writeln ' )
You can’t perform that action at this time.
0 commit comments