Closed Tigrov closed 11 months ago
Improvements to the JsonTest.php
The JsonTest.php
file has been improved for better functionality. Key modifications are made to test how objects get translated or "encoded" into JSON format.
Inclusion of the ArrayObject class
The ArrayObject
class has been included via a use
statement. This class allows arrays to behave like objects which helps in advanced operations.
Changes to the 'testEncodeObjectProperties' method
The testEncodeObjectProperties
method was fine-tuned to only check ('assert') the result when the object Properties
is converted ('encoded') to JSON.
Addition of 'testEncodeJsonSerializableWithPreprocessing' method
A new method called testEncodeJsonSerializableWithPreprocessing
was added. This new method checks the result when an array with the elements 1, 2, and 3, put inside a Data
object, is converted to JSON format.
See section
About jsonSerialize()
at #41