mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
15 lines
334 B
PHP
15 lines
334 B
PHP
<?php
|
|
|
|
use PHPUnit\Framework\ExpectationFailedException;
|
|
|
|
test('it properly parses json string', function () {
|
|
expect('{"name":"Nuno"}')
|
|
->json()
|
|
->name
|
|
->toBe('uno');
|
|
});
|
|
|
|
test('fails with broken json string', function () {
|
|
expect('{":"Nuno"}')->json();
|
|
})->throws(ExpectationFailedException::class);
|