I have created a Service where JSON is retrieved from an external source and queried. I want to be able to test functions that use this service, independent of the service. How do I mock the JSON file in PHP Unit Tests in order to test these functions? The JSON file formatted like this:
{
"data": [
{
"title": "Development",
"children": [
{
"title": "Settings",
"channel_types": [
{
"title": "Network"
}
]
},
{
"title": "Testing",
"channel_types": [
{
"title": "Social"
}
]
}
],
"created_at": 1523464038,
"updated_at": 1523464038,
"id": "5ace37664e1d4400a04ffaf2"
}
]
}