25
25
26
26
/**
27
27
* Class Process
28
- *
29
28
*/
30
29
class PHPUnitUtils extends \PHPUnit_Util_PHP
31
30
{
@@ -38,9 +37,7 @@ class PHPUnitUtils extends \PHPUnit_Util_PHP
38
37
*/
39
38
public function runJob ($ job , array $ settings = [])
40
39
{
41
- throw new \PHPUnit_Framework_Exception (
42
- 'Should not call this method. '
43
- );
40
+ throw new \PHPUnit_Framework_Exception ('Should not call this method. ' );
44
41
}
45
42
46
43
/**
@@ -53,7 +50,7 @@ public function runJob($job, array $settings = [])
53
50
*/
54
51
protected function process ($ pipe , $ job )
55
52
{
56
- /* do nothing * /
53
+ //
57
54
}
58
55
59
56
/**
@@ -76,11 +73,7 @@ public function processChildResult(
76
73
$ time = 0 ;
77
74
78
75
if (!empty ($ stderr )) {
79
- $ result ->addError (
80
- $ test ,
81
- new \PHPUnit_Framework_Exception (trim ($ stderr )),
82
- $ time
83
- );
76
+ $ result ->addError ($ test , new \PHPUnit_Framework_Exception (trim ($ stderr )), $ time );
84
77
} else {
85
78
set_error_handler (
86
79
function ($ errno , $ errstr , $ errfile , $ errline ) {
@@ -98,11 +91,7 @@ function ($errno, $errstr, $errfile, $errline) {
98
91
restore_error_handler ();
99
92
$ childResult = false ;
100
93
101
- $ result ->addError (
102
- $ test ,
103
- new \PHPUnit_Framework_Exception (trim ($ stdout ), 0 , $ e ),
104
- $ time
105
- );
94
+ $ result ->addError ($ test , new \PHPUnit_Framework_Exception (trim ($ stdout ), 0 , $ e ), $ time );
106
95
}
107
96
108
97
if ($ childResult !== false ) {
@@ -116,9 +105,7 @@ function ($errno, $errstr, $errfile, $errline) {
116
105
$ childResult = $ childResult ['result ' ];
117
106
118
107
if ($ result ->getCollectCodeCoverageInformation ()) {
119
- $ result ->getCodeCoverage ()->merge (
120
- $ childResult ->getCodeCoverage ()
121
- );
108
+ $ result ->getCodeCoverage ()->merge ($ childResult ->getCodeCoverage ());
122
109
}
123
110
124
111
$ time = $ childResult ->time ();
@@ -129,38 +116,43 @@ function ($errno, $errstr, $errfile, $errline) {
129
116
$ failures = $ childResult ->failures ();
130
117
131
118
if (!empty ($ notImplemented )) {
132
- $ result ->addError (
133
- $ test ,
134
- $ this ->getException ($ notImplemented [0 ]),
135
- $ time
136
- );
137
- } elseif (!empty ($ risky )) {
138
- $ result ->addError (
139
- $ test ,
140
- $ this ->getException ($ risky [0 ]),
141
- $ time
142
- );
143
- } elseif (!empty ($ skipped )) {
144
- $ result ->addError (
145
- $ test ,
146
- $ this ->getException ($ skipped [0 ]),
147
- $ time
148
- );
149
- } elseif (!empty ($ errors )) {
150
- foreach ($ errors as $ error ) {
151
- $ result ->addError (
152
- $ test ,
153
- $ this ->getException ($ error ),
154
- $ time
155
- );
119
+ foreach ($ notImplemented as $ variation => $ error ) {
120
+ $ name = $ test ->getName ();
121
+ $ test ->setName ($ name . " variation $ variation " );
122
+ $ result ->addError ($ test , $ this ->getException ($ error ), $ time );
123
+ $ test ->setName ($ name );
156
124
}
157
- } elseif (!empty ($ failures )) {
158
- foreach ($ failures as $ failure ) {
159
- $ result ->addFailure (
160
- $ test ,
161
- $ this ->getException ($ failure ),
162
- $ time
163
- );
125
+ }
126
+ if (!empty ($ risky )) {
127
+ foreach ($ risky as $ variation => $ error ) {
128
+ $ name = $ test ->getName ();
129
+ $ test ->setName ($ name . " variation $ variation " );
130
+ $ result ->addError ($ test , $ this ->getException ($ error ), $ time );
131
+ $ test ->setName ($ name );
132
+ }
133
+ }
134
+ if (!empty ($ skipped )) {
135
+ foreach ($ skipped as $ variation => $ error ) {
136
+ $ name = $ test ->getName ();
137
+ $ test ->setName ($ name . " variation $ variation " );
138
+ $ result ->addError ($ test , $ this ->getException ($ error ), $ time );
139
+ $ test ->setName ($ name );
140
+ }
141
+ }
142
+ if (!empty ($ errors )) {
143
+ foreach ($ errors as $ variation => $ error ) {
144
+ $ name = $ test ->getName ();
145
+ $ test ->setName ($ name . " variation $ variation " );
146
+ $ result ->addError ($ test , $ this ->getException ($ error ), $ time );
147
+ $ test ->setName ($ name );
148
+ }
149
+ }
150
+ if (!empty ($ failures )) {
151
+ foreach ($ failures as $ variation => $ failure ) {
152
+ $ name = $ test ->getName ();
153
+ $ test ->setName ($ name . " variation $ variation " );
154
+ $ result ->addFailure ($ test , $ this ->getException ($ failure ), $ time );
155
+ $ test ->setName ($ name );
164
156
}
165
157
}
166
158
}
@@ -189,11 +181,7 @@ public function getException(\PHPUnit_Framework_TestFailure $error)
189
181
}
190
182
191
183
$ exception = new \PHPUnit_Framework_SyntheticError (
192
- sprintf (
193
- '%s: %s ' ,
194
- $ exceptionArray ['_PHP_Incomplete_Class_Name ' ],
195
- $ exceptionArray ['message ' ]
196
- ),
184
+ sprintf ('%s: %s ' , $ exceptionArray ['_PHP_Incomplete_Class_Name ' ], $ exceptionArray ['message ' ]),
197
185
$ exceptionArray ['code ' ],
198
186
$ exceptionArray ['file ' ],
199
187
$ exceptionArray ['line ' ],
0 commit comments