Skip to content

Commit b439a50

Browse files
committed
Merge branch 'hotfix/1.1.5'
2 parents dda491c + 2fa08fe commit b439a50

File tree

5 files changed

+50
-3
lines changed

5 files changed

+50
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Homestead.yaml
1111
npm-debug.log
1212
yarn-error.log
1313
.env
14-
.phpunit.result.cache
14+
.phpunit.result.cache
15+
.php_cs.cache

.php_cs.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('tests/Fixtures')
5+
->in(__DIR__);
6+
7+
$config = PhpCsFixer\Config::create()
8+
->setRiskyAllowed(true)
9+
->setRules([
10+
'@PSR2' => true,
11+
'array_indentation' => true,
12+
'trailing_comma_in_multiline_array' => true,
13+
'method_chaining_indentation' => true,
14+
'binary_operator_spaces' => true,
15+
'strict_comparison' => true,
16+
'standardize_not_equals' => true,
17+
'strict_param' => true,
18+
'concat_space' => ['spacing' => 'one'],
19+
'array_syntax' => ['syntax' => 'short'],
20+
'no_unused_imports' => true,
21+
'no_useless_else' => true,
22+
'blank_line_before_statement' => true,
23+
'whitespace_after_comma_in_array' => true,
24+
])
25+
->setFinder($finder);
26+
27+
return $config;

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ php:
55

66
before_script: composer install
77

8-
script: ./vendor/bin/phpunit
8+
script:
9+
- ./vendor/bin/phpunit
10+
- ./vendor/bin/php-cs-fixer fix src/
11+
- ./vendor/bin/php-cs-fixer fix tests/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sempro/phpunit-pretty-print",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "Prettify PHPUnit output",
55
"type": "library",
66
"license": "MIT",

src/PrettyPrinter.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,36 @@ public function endTest(Test $test, float $time): void
5757
switch ($test->getStatus()) {
5858
case BaseTestRunner::STATUS_PASSED:
5959
$this->writeWithColor('fg-green', $name, false);
60+
6061
break;
6162
case BaseTestRunner::STATUS_SKIPPED:
6263
$this->writeWithColor('fg-yellow', $name, false);
64+
6365
break;
6466
case BaseTestRunner::STATUS_INCOMPLETE:
6567
$this->writeWithColor('fg-blue', $name, false);
68+
6669
break;
6770
case BaseTestRunner::STATUS_FAILURE:
6871
$this->writeWithColor('fg-red', $name, false);
72+
6973
break;
7074
case BaseTestRunner::STATUS_ERROR:
7175
$this->writeWithColor('fg-red', $name, false);
76+
7277
break;
7378
case BaseTestRunner::STATUS_RISKY:
7479
$this->writeWithColor('fg-magenta', $name, false);
80+
7581
break;
7682
case BaseTestRunner::STATUS_WARNING:
7783
$this->writeWithColor('fg-yellow', $name, false);
84+
7885
break;
7986
case BaseTestRunner::STATUS_UNKNOWN:
8087
default:
8188
$this->writeWithColor('fg-cyan', $name, false);
89+
8290
break;
8391
}
8492

@@ -101,27 +109,35 @@ protected function writeProgress(string $progress): void
101109
switch (strtoupper(preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $progress))) {
102110
case '.':
103111
$this->writeWithColor('fg-green', '', false);
112+
104113
break;
105114
case 'S':
106115
$this->writeWithColor('fg-yellow', '', false);
116+
107117
break;
108118
case 'I':
109119
$this->writeWithColor('fg-blue', '', false);
120+
110121
break;
111122
case 'F':
112123
$this->writeWithColor('fg-red', ' x', false);
124+
113125
break;
114126
case 'E':
115127
$this->writeWithColor('fg-red', '', false);
128+
116129
break;
117130
case 'R':
118131
$this->writeWithColor('fg-magenta', '', false);
132+
119133
break;
120134
case 'W':
121135
$this->writeWithColor('fg-yellow', ' ¤', false);
136+
122137
break;
123138
default:
124139
$this->writeWithColor('fg-cyan', '', false);
140+
125141
break;
126142
}
127143
}

0 commit comments

Comments
 (0)