Closed stevenrombauts closed 6 years ago
While I honestly appreciate the the time and effort that went into this, I do not believe this is functionality I am interested in having or maintaining.
Additionally I feel this functionality would be better implemented as a system of Builders and Factories external to the classes themselves - as they do not need private access to anything within the classes themselves. Single responsibility principle and what not.
No problem, @donatj, thank you for considering it. I can put this logic in my own code as well. Using a Builder would be a clean solution to this problem, I might give that another try in my own code then.
Purpose
This PR makes it possible to add paths and their responses through a JSON file or JSON object. It adds the
MockWebServer::load($json)
method and the staticResponseInterface::create()
function in order to do so.Example
For a complete example, please see the
tests/deserialize.php
example.Tests
New tests are added in the
DeserializationTest
file.Misc
If there are any changes you'd like to see to this PR, just let me know. Thanks again :)