Files
pest/tests/Features/Expect/json.php
T
2026-07-18 01:10:01 +01:00

15 lines
347 B
PHP

<?php
use PHPUnit\Framework\ExpectationFailedException;
test('it properly parses json string', function (): void {
expect('{"name":"Nuno"}')
->json()
->name
->toBe('Nuno');
});
test('fails with broken json string', function (): void {
expect('{":"Nuno"}')->json();
})->throws(ExpectationFailedException::class);