Skip to content

Commit 1e9b4dc

Browse files
committed
3 commit
1 parent 9133ac4 commit 1e9b4dc

4 files changed

Lines changed: 39 additions & 19 deletions

File tree

Makefile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,27 @@ require:
1313
lint:
1414
composer exec --verbose phpcs -- --standard=PSR12 src bin tests
1515

16+
lint-fix:
17+
composer lint-fix
18+
1619
test:
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

bin/gendiff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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) {

phpunit.xml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
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>

src/Formatters/Plain.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)