Skip to content

Commit ef05a96

Browse files
committed
Revert to original error messages for backwards compatibility
1 parent f29bf2d commit ef05a96

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Schema.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ private function processNot($data, Context $options, $path)
305305
// Expected exception
306306
}
307307
if ($exception === false) {
308-
$this->fail((new LogicException('Not ' . json_encode($this->not) . ' expected'))->withData($data), $path . '->not');
308+
$this->fail((new LogicException('Not ' . json_encode($this->not) . ' expected, ' . json_encode($data) . ' received'))
309+
->withData($data), $path . '->not');
309310
}
310311
}
311312

tests/src/PHPUnit/Error/ErrorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ public function testNoSubErrors()
235235
try {
236236
$schema->in('abc');
237237
} catch (InvalidValue $exception) {
238-
$this->assertSame('Not {"type":"string"} expected at #->not', $exception->getMessage());
238+
$this->assertSame('Not {"type":"string"} expected, "abc" received at #->not', $exception->getMessage());
239239

240240
$error = $exception->inspect();
241-
$this->assertSame('Not {"type":"string"} expected', $error->error);
241+
$this->assertSame('Not {"type":"string"} expected, "abc" received', $error->error);
242242
}
243243
}
244244

0 commit comments

Comments
 (0)