mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 02:07:23 +01:00
feat: move Expectations API out of external plugin
This commit is contained in:
17
tests/Features/Expect/toBeJson.php
Normal file
17
tests/Features/Expect/toBeJson.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect('{"hello":"world"}')->toBeJson();
|
||||
expect('foo')->not->toBeJson();
|
||||
expect('{"hello"')->not->toBeJson();
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(':"world"}')->toBeJson();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect('{"hello":"world"}')->not->toBeJson();
|
||||
})->throws(ExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user