Skip to content

Commit f015397

Browse files
committed
\JSON_PRETTY_PRINT doesn't exist in PHP-5.3, so work around this
1 parent 05ede63 commit f015397

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/Constraints/CoerciveTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ public function testCoerceCases($schema, $data, $startType, $endType, $endValue,
175175

176176
// check validity
177177
if ($valid) {
178+
$prettyPrint = defined('\JSON_PRETTY_PRINT') ? constant('\JSON_PRETTY_PRINT') : 0;
178179
$this->assertTrue(
179180
$validator->isValid(),
180-
'Validation failed: ' . json_encode($validator->getErrors(), \JSON_PRETTY_PRINT)
181+
'Validation failed: ' . json_encode($validator->getErrors(), $prettyPrint)
181182
);
182183

183184
// check end type

0 commit comments

Comments
 (0)