File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,8 +13,27 @@ require:
1313lint :
1414 composer exec --verbose phpcs -- --standard=PSR12 src bin tests
1515
16+ lint-fix :
17+ composer lint-fix
18+
1619test :
17- composer test
20+ composer exec --verbose phpunit tests
1821
19- lint-fix :
20- composer lint-fix
22+ test-coverage :
23+ XDEBUG_MODE=coverage composer exec --verbose phpunit tests -- --coverage-clover=build/logs/clover.xml
24+
25+ test-coverage-text :
26+ XDEBUG_MODE=coverage composer exec --verbose phpunit tests -- --coverage-text
27+
28+ test1 :
29+ php ./bin/gendiff ./tests/fixtures/file1.yaml ./tests/fixtures/file2.yaml
30+ test2 :
31+ php ./bin/gendiff ./tests/fixtures/file1.json ./tests/fixtures/file2.json
32+ test3 :
33+ php ./bin/gendiff ./tests/fixtures/file1.json ./tests/fixtures/file2.json --format plain
34+ test4 :
35+ php ./bin/gendiff ./tests/fixtures/file1.yaml ./tests/fixtures/file2.yaml --format plain
36+ test5 :
37+ php ./bin/gendiff ./tests/fixtures/file1.yaml ./tests/fixtures/file2.yaml --format json
38+ test6 :
39+ php ./bin/gendiff ./tests/fixtures/file1.json ./tests/fixtures/file2.json --format json
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function main(): void
4848 $ file2 = $ response ['<secondFile> ' ];
4949 $ format = $ response ['--format ' ];
5050
51- $ diff = genDiff ($ file1 , $ file2 );
51+ $ diff = genDiff ($ file1 , $ file2, $ format );
5252 echo $ diff . "\n" ;
5353
5454 } catch (Exception $ e ) {
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.5 /phpunit.xsd"
3+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.6 /phpunit.xsd"
44 bootstrap =" vendor/autoload.php"
5- colors = " true "
5+ cacheResultFile = " .phpunit.cache/test-results "
66 executionOrder =" depends,defects"
7- backupGlobals =" false"
7+ forceCoversAnnotation =" true"
8+ beStrictAboutCoversAnnotation =" true"
89 beStrictAboutOutputDuringTests =" true"
9- displayDetailsOnTestsThatTriggerDeprecations =" true"
10- displayDetailsOnTestsThatTriggerErrors =" true"
11- displayDetailsOnTestsThatTriggerNotices =" true"
12- displayDetailsOnTestsThatTriggerWarnings =" true"
13- displayDetailsOnPhpunitDeprecations =" true"
14- stopOnFailure =" true"
15- >
10+ beStrictAboutTodoAnnotatedTests =" true"
11+ convertDeprecationsToExceptions =" true"
12+ failOnRisky =" true"
13+ failOnWarning =" true"
14+ verbose =" true" >
1615 <testsuites >
1716 <testsuite name =" default" >
1817 <directory >tests</directory >
1918 </testsuite >
2019 </testsuites >
2120
22- <logging >
23- <junit outputFile =" build/logs/junit.xml" />
24- </logging >
25- </phpunit >
21+ <coverage cacheDirectory =" .phpunit.cache/code-coverage"
22+ processUncoveredFiles =" true" >
23+ <include >
24+ <directory suffix =" .php" >src</directory >
25+ </include >
26+ </coverage >
27+ </phpunit >
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ function buildLines(array $diff, string $path = ''): array
1616
1717 foreach ($ diff as $ node ) {
1818 $ currentPath = $ path === '' ? $ node ['key ' ] : "{$ path }. {$ node ['key ' ]}" ;
19-
2019 switch ($ node ['type ' ]) {
2120 case 'nested ' :
2221 $ nestedLines = buildLines ($ node ['children ' ], $ currentPath );
You can’t perform that action at this time.
0 commit comments