Open olivierobert opened 1 year ago
The current test https://github.com/paladin3895/google-search/blob/master/tests/Feature/GoogleSearchTest.php makes an external request to Google. The risk is that this test could sometimes fail due to network latency and security (rate-limiting from Google) issues, thus giving false negatives. The test is brittle in its current state.
The tests for SearchEngine should not make a network request. It should remain a unit test, hence having no dependency outside of the class under test.
SearchEngine
This is indeed an issue with the unit test. It should use a mock HTTP client to simulate search requests. I will schedule a fix today. Cheers,
Hi Olivier, this issue has been dealt with in this pull request #9
Issue
The current test https://github.com/paladin3895/google-search/blob/master/tests/Feature/GoogleSearchTest.php makes an external request to Google. The risk is that this test could sometimes fail due to network latency and security (rate-limiting from Google) issues, thus giving false negatives. The test is brittle in its current state.
Expected
The tests for
SearchEngine
should not make a network request. It should remain a unit test, hence having no dependency outside of the class under test.