This question already has an answer here:
I have a site programmed in PHP where I make more call to external server that return me big xml of data. For each record of the xml I have to make other external call to get other data.
So my function logic is:
1) make external request in XML
2) get the response XML
3) for each record of the XML make another external request in XML
So there are three functions to get all data for my page. In theory to make good tests I need to create a test for each function, but the problem is that every function is linked with the other function because I need record data to make the last function.
So is correct to create a big test that include all functions in sequence to have all data to make all functions or is better another way that I don't know?
I make test with PHPUnit but I would like to know if this practice is a good practice or there is another way to make good test for this feature.
Consider that I make more external request (Point 3) not only one so I have more functions to get all data that I need (I have already cut data that I don't need).