File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -48,16 +48,20 @@ jobs:
48
48
49
49
- name : Set PHPUnit version
50
50
if : matrix.php >= 8.1
51
- run : composer require "phpunit/phpunit:^8.5.41 " --no-update
51
+ run : composer require "phpunit/phpunit:^9.6.22 " --no-update
52
52
53
53
- name : Install Dependencies
54
54
run : composer update --prefer-dist --prefer-${{ matrix.setup }} --no-interaction --no-suggest
55
55
56
+ - name : Run Tests with coverage
57
+ if : matrix.php == 8.4 && matrix.setup == 'stable'
58
+ run : vendor/bin/phpunit --coverage-clover=clover.xml --coverage-text --log-junit=test-results.xml
59
+
56
60
- name : Run Tests
57
- run : vendor/bin/phpunit ${{ matrix.php == 8.4 && matrix.setup == 'stable' && '--coverage-clover=clover.xml --coverage-text --log-junit test-results.xml' || '' }}
61
+ if : matrix.php != 8.4 || matrix.setup != 'stable'
62
+ run : vendor/bin/phpunit --log-junit=test-results.xml
58
63
59
64
- name : Upload Test Results
60
- if : matrix.php == 8.4 && matrix.setup == 'stable'
61
65
uses : actions/upload-artifact@v4
62
66
with :
63
67
name : " ${{ matrix.php-version }}-phpunit-results"
Original file line number Diff line number Diff line change 17
17
"nesbot/carbon" : " ^2.72.6 || ^3.0"
18
18
},
19
19
"require-dev" : {
20
- "phpunit/phpunit" : " ^7.5.20 || ^8.5.41"
20
+ "phpunit/phpunit" : " ^7.5.20 || ^8.5.41 || ^9.6.22 "
21
21
},
22
22
"autoload" : {
23
23
"psr-4" : {
Original file line number Diff line number Diff line change @@ -58,8 +58,9 @@ public function testGetMethodSourceCode()
58
58
$ foo = new ReflectionMethod (get_class ($ object ), 'foo ' );
59
59
60
60
$ sourceCode = $ method ->invoke ($ generator , $ foo );
61
+ $ match = (preg_match ('/public function foo\(\)\s*\{\s*return \'hello \';/ ' , $ sourceCode ) > 0 );
61
62
62
- $ this ->assertRegExp ( ' /public function foo\(\)\s*\{\s*return \' hello \' ;/ ' , $ sourceCode );
63
+ $ this ->assertTrue ( $ match , ' Source code must contain foo method returning " hello". ' );
63
64
}
64
65
65
66
/**
You can’t perform that action at this time.
0 commit comments