Lets say you have a website, that uses a function to retrieve data from the database and returns the result to be displayed/parsed/etc...
Since the data that is retrieve
Unit tests, in their ideal form, should only test one thing. In this case, you're testing two things:
So I would suggest the following refactor:
Also, typically it's a good idea to run unit tests in a test environment where you have complete control over what's stored in the database. You don't want to run these against production data.