@@ -216,7 +216,7 @@ appropriate (e.g., inside a ``filter()`` expression).
216216Testing with JSON Assertions
217217----------------------------
218218
219- The component provides a set of PHPUnit assertions to make testing JSON data more convenient. To use them, include the
219+ The component provides a set of PHPUnit assertions to make testing JSON data more convenient. Use the
220220:class: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait ` in your test class::
221221
222222 use PHPUnit\Framework\TestCase;
@@ -237,52 +237,52 @@ The component provides a set of PHPUnit assertions to make testing JSON data mor
237237The trait provides the following assertion methods:
238238
239239* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathCount `
240- Asserts that the number of elements found by the JSONPath expression matches an expected count::
240+ Asserts that the number of elements found by the JSONPath expression matches an expected count::
241241
242- $json = '{"a": [1, 2, 3]}';
243- self::assertJsonPathCount(3, '$.a[*]', $json);
242+ $json = '{"a": [1, 2, 3]}';
243+ self::assertJsonPathCount(3, '$.a[*]', $json);
244244
245245* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathEquals `
246- Asserts that the result of a JSONPath expression is equal (`` == ``) to an expected value. This assertion uses type coercion::
246+ Asserts that the result of a JSONPath expression is equal to an expected value.The comparison uses `` == `` ( type coercion) instead of `` === `` ::
247247
248- $json = '{"a": [1, 2, 3]}';
248+ $json = '{"a": [1, 2, 3]}';
249249
250- // passes because "1" == 1
251- self::assertJsonPathEquals(['1'], '$.a[0]', $json);
250+ // passes because "1" == 1
251+ self::assertJsonPathEquals(['1'], '$.a[0]', $json);
252252
253253* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathNotEquals `
254- Asserts that the result of a JSONPath expression is not equal ( ``!= ``) to an expected value ::
254+ Asserts that the result of a JSONPath expression is not equal to an expected value.The comparison uses ``!= `` (type coercion) instead of `` !== `` ::
255255
256- $json = '{"a": [1, 2, 3]}';
257- self::assertJsonPathNotEquals([42], '$.a[0]', $json);
256+ $json = '{"a": [1, 2, 3]}';
257+ self::assertJsonPathNotEquals([42], '$.a[0]', $json);
258258
259259* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathSame `
260- Asserts that the result of a JSONPath expression is identical (``=== ``) to an expected value. This is a strict comparison and does not perform type coercion::
260+ Asserts that the result of a JSONPath expression is identical (``=== ``) to an expected value. This is a strict comparison and does not perform type coercion::
261261
262- $json = '{"a": [1, 2, 3]}';
262+ $json = '{"a": [1, 2, 3]}';
263263
264- // fails because "1" !== 1
265- // self::assertJsonPathSame(['1'], '$.a[0]', $json);
264+ // fails because "1" !== 1
265+ // self::assertJsonPathSame(['1'], '$.a[0]', $json);
266266
267- self::assertJsonPathSame([1], '$.a[0]', $json);
267+ self::assertJsonPathSame([1], '$.a[0]', $json);
268268
269269* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathNotSame `
270- Asserts that the result of a JSONPath expression is not identical (``!== ``) to an expected value::
270+ Asserts that the result of a JSONPath expression is not identical (``!== ``) to an expected value::
271271
272- $json = '{"a": [1, 2, 3]}';
273- self::assertJsonPathNotSame(['1'], '$.a[0]', $json);
272+ $json = '{"a": [1, 2, 3]}';
273+ self::assertJsonPathNotSame(['1'], '$.a[0]', $json);
274274
275275* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathContains `
276- Asserts that a given value is found within the array of results from the JSONPath expression::
276+ Asserts that a given value is found within the array of results from the JSONPath expression::
277277
278- $json = '{"tags": ["php", "symfony", "json"]}';
279- self::assertJsonPathContains('symfony', '$.tags[*]', $json);
278+ $json = '{"tags": ["php", "symfony", "json"]}';
279+ self::assertJsonPathContains('symfony', '$.tags[*]', $json);
280280
281281* :method: `Symfony\\ Component\\ JsonPath\\ Test\\ JsonPathAssertionsTrait::assertJsonPathNotContains `
282- Asserts that a given value is NOT found within the array of results from the JSONPath expression::
282+ Asserts that a given value is NOT found within the array of results from the JSONPath expression::
283283
284- $json = '{"tags": ["php", "symfony", "json"]}';
285- self::assertJsonPathNotContains('java', '$.tags[*]', $json);
284+ $json = '{"tags": ["php", "symfony", "json"]}';
285+ self::assertJsonPathNotContains('java', '$.tags[*]', $json);
286286
287287Error Handling
288288--------------
0 commit comments