File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -123,21 +123,24 @@ function generateTests(array $tests, $opts = [
123
123
])
124
124
{
125
125
$ GLOBALS ['GENERATE_TESTS ' ] = true ;
126
+ $ GLOBALS ['FORCE_PHP_GENERATE ' ] = $ opts ['force ' ];
126
127
require 'tests ' . DIRECTORY_SEPARATOR . 'functional ' . DIRECTORY_SEPARATOR . '_bootstrap.php ' ;
128
+
127
129
$ testObjects = [];
128
130
$ suitesReferences = [];
129
131
130
- if ($ opts ['force ' ])
131
- {
132
- $ GLOBALS ['FORCE_PHP_GENERATE ' ] = true ;
133
- }
134
-
135
- if ($ opts ['tests ' ]) {
132
+ if ($ opts ['tests ' ] != null ) {
136
133
$ testConfigArray = json_decode ($ opts ['tests ' ],true );
137
134
$ tests = $ testConfigArray ['tests ' ] ?? [];
138
135
$ suitesReferences = $ testConfigArray ['suites ' ] ?? [];
139
136
}
140
137
138
+ // stop execution if we have failed to properly parse any json
139
+ if (json_last_error () != JSON_ERROR_NONE ) {
140
+ $ this ->say ("JSON could not be parsed: " . json_last_error_msg ());
141
+ return ;
142
+ }
143
+
141
144
if (!empty ($ tests ))
142
145
{
143
146
foreach ($ tests as $ test )
You can’t perform that action at this time.
0 commit comments