File tree Expand file tree Collapse file tree 7 files changed +103
-0
lines changed Expand file tree Collapse file tree 7 files changed +103
-0
lines changed Original file line number Diff line number Diff line change
1
+ /.gitignore export-ignore
2
+ /.github export-ignore
3
+ /tests export-ignore
4
+ /phpunit.xml export-ignore
Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on : push
4
+
5
+ jobs :
6
+ php-tests :
7
+
8
+ strategy :
9
+ matrix :
10
+ php :
11
+ - 7.4
12
+ - 8.0
13
+ - 8.1
14
+ - 8.2
15
+ - 8.3
16
+ prefer :
17
+ - lowest
18
+ - stable
19
+
20
+ name : Test on PHP ${{ matrix.php }} with ${{ matrix.prefer }} composer prefer option
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Checkout Code
25
+ uses : actions/checkout@v4
26
+
27
+ - name : Install PHP
28
+ uses : shivammathur/setup-php@v2
29
+ with :
30
+ php-version : ${{ matrix.php }}
31
+
32
+ - name : Check PHP Version
33
+ run : php -v
34
+
35
+ - name : Cache Composer packages
36
+ id : composer-cache
37
+ uses : actions/cache@v4
38
+ with :
39
+ path : vendor
40
+ key : ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.prefer }}-
41
+ restore-keys : |
42
+ ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.prefer }}-
43
+
44
+ - name : Install dependencies
45
+ if : steps.composer-cache.outputs.cache-hit != 'true'
46
+ run : composer update --prefer-${{ matrix.prefer }} --prefer-dist --no-progress
47
+
48
+ - name : Run tests
49
+ run : vendor/bin/phpunit
Original file line number Diff line number Diff line change 1
1
/.idea /
2
2
/vendor /
3
+
4
+ /.phpunit.cache
3
5
/composer.lock
Original file line number Diff line number Diff line change 15
15
"files" : [
16
16
" ./src/config_builder.php"
17
17
]
18
+ },
19
+ "require-dev" : {
20
+ "phpunit/phpunit" : " ^9.6 | ^10.5"
18
21
}
19
22
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.5/phpunit.xsd"
4
+ bootstrap =" vendor/autoload.php"
5
+ cacheDirectory =" .phpunit.cache"
6
+ executionOrder =" depends,defects"
7
+ requireCoverageMetadata =" false"
8
+ beStrictAboutCoverageMetadata =" true"
9
+ beStrictAboutOutputDuringTests =" true"
10
+ failOnRisky =" true"
11
+ failOnWarning =" true" >
12
+ <testsuites >
13
+ <testsuite name =" default" >
14
+ <directory >tests</directory >
15
+ </testsuite >
16
+ </testsuites >
17
+
18
+ <source restrictDeprecations =" true" restrictNotices =" true" restrictWarnings =" true" >
19
+ <include >
20
+ <directory >src</directory >
21
+ </include >
22
+ </source >
23
+ </phpunit >
Original file line number Diff line number Diff line change 39
39
'no_break_comment ' => false ,
40
40
'no_superfluous_phpdoc_tags ' => true ,
41
41
'nullable_type_declaration_for_default_null_value ' => true ,
42
+
43
+ 'php_unit_test_class_requires_covers ' => false ,
44
+ 'php_unit_internal_class ' => false ,
45
+
42
46
'ordered_class_elements ' => ['order ' => [
43
47
'use_trait ' ,
44
48
'case ' ,
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace StudService \PhpCsFixerTests ;
4
+
5
+ use PhpCsFixer \Finder ;
6
+ use PHPUnit \Framework \TestCase ;
7
+ use function StudService \PhpCsFixer \build_config ;
8
+
9
+ class config_builderTest extends TestCase
10
+ {
11
+ public function test_build_config ()
12
+ {
13
+ $ config = build_config (new Finder ());
14
+
15
+ $ this ->assertFalse ($ config ->getRiskyAllowed ());
16
+ $ this ->assertSame ("\n" , $ config ->getLineEnding ());
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments