Files
json-parser/tests/Feature/ParsingTest.php
Andrea Marco Sartori 78c8531879 Create tests
2022-11-07 23:45:07 +10:00

18 lines
591 B
PHP

<?php
use Cerbero\JsonParser\Dataset;
use Cerbero\JsonParser\JsonParser;
it('parses JSON when instantiated', function (string $json, array $parsed) {
expect(new JsonParser($json))->toParseTo($parsed);
})->with(Dataset::forParsing());
it('parses JSON when calling the factory method', function (string $json, array $parsed) {
expect(JsonParser::parse($json))->toParseTo($parsed);
})->with(Dataset::forParsing());
it('parses JSON when calling the helper', function (string $json, array $parsed) {
expect(parseJson($json))->toParseTo($parsed);
})->with(Dataset::forParsing());