Skip to content

Commit fadc96f

Browse files
authored
pretty-print infection-config.php json (#22)
1 parent daf2348 commit fadc96f

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

bin/infection-config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
$decoded->timeout = (int) $timeout;
2828
}
2929

30-
echo json_encode($decoded);
30+
echo json_encode($decoded, JSON_PRETTY_PRINT);
3131

3232
exit(0);

tests/phpt/infection-config-default.phpt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ infection-config.php renders proper json defaults
33
--FILE--
44
<?php declare(strict_types=1);
55
$bin = PHP_BINARY . ' '. __DIR__.'/../../bin/infection-config.php';
6-
echo shell_exec($bin ."| jq");
6+
echo shell_exec($bin);
77
--EXPECT--
88
{
9-
"$schema": "vendor/infection/infection/resources/schema.json",
10-
"timeout": 30,
11-
"source": {
12-
"directories": [
13-
"src"
14-
]
15-
},
16-
"staticAnalysisTool": "phpstan",
17-
"logs": {
18-
"text": "tmp/infection.log"
19-
},
20-
"mutators": {
21-
"@default": false,
22-
"PHPStan\\Infection\\TrinaryLogicMutator": true
23-
},
24-
"bootstrap": "build-infection/vendor/autoload.php"
9+
"$schema": "vendor\/infection\/infection\/resources\/schema.json",
10+
"timeout": 30,
11+
"source": {
12+
"directories": [
13+
"src"
14+
]
15+
},
16+
"staticAnalysisTool": "phpstan",
17+
"logs": {
18+
"text": "tmp\/infection.log"
19+
},
20+
"mutators": {
21+
"@default": false,
22+
"PHPStan\\Infection\\TrinaryLogicMutator": true
23+
},
24+
"bootstrap": "build-infection\/vendor\/autoload.php"
2525
}

tests/phpt/infection-config.phpt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ infection-config.php renders proper json
33
--FILE--
44
<?php declare(strict_types=1);
55
$bin = PHP_BINARY . ' '. __DIR__.'/../../bin/infection-config.php';
6-
echo shell_exec($bin." --source-directory='more/files/' --timeout=180 --mutator-class='My\Class' | jq");
6+
echo shell_exec($bin." --source-directory='more/files/' --timeout=180 --mutator-class='My\Class'");
77
--EXPECT--
88
{
9-
"$schema": "vendor/infection/infection/resources/schema.json",
10-
"timeout": 180,
11-
"source": {
12-
"directories": [
13-
"src",
14-
"more/files/"
15-
]
16-
},
17-
"staticAnalysisTool": "phpstan",
18-
"logs": {
19-
"text": "tmp/infection.log"
20-
},
21-
"mutators": {
22-
"@default": false,
23-
"PHPStan\\Infection\\TrinaryLogicMutator": true,
24-
"My\\Class": true
25-
},
26-
"bootstrap": "build-infection/vendor/autoload.php"
9+
"$schema": "vendor\/infection\/infection\/resources\/schema.json",
10+
"timeout": 180,
11+
"source": {
12+
"directories": [
13+
"src",
14+
"more\/files\/"
15+
]
16+
},
17+
"staticAnalysisTool": "phpstan",
18+
"logs": {
19+
"text": "tmp\/infection.log"
20+
},
21+
"mutators": {
22+
"@default": false,
23+
"PHPStan\\Infection\\TrinaryLogicMutator": true,
24+
"My\\Class": true
25+
},
26+
"bootstrap": "build-infection\/vendor\/autoload.php"
2727
}

0 commit comments

Comments
 (0)