galen / PHP-Instagram-API

PHP 5.3+ wrapper for the Instagram API
338 stars 159 forks source link

Tests are useless #37

Open manjencic opened 10 years ago

manjencic commented 10 years ago

You shouldn't use real data in your tests because it depends on their existence in database which you are not going to test. In InstagramTest.php you test a lot of functions using access_token (which is of course now expired) and that mean you test Instagram too, which is not your business. What if Instagram is down for a moment or real data you use doesn't exists any more (like access_token) and run your tests? Your tests will fail but it is not because your code is wrong.

Instead of that, tests should deal with mock objects and tests only your code separated from third parties because, in this case, we expect that Instagram API works well. That is not our business, we want to take care about our code only.