From 9d5a5566a090fc81d9733cb998c586392d30c7a9 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 27 Oct 2020 13:19:40 +0000 Subject: [PATCH] Test real responses on local and not on travis. Its easier that way and avoid problems due to slow responses from providers. --- phpunit.xml.dist | 1 - tests/Embera/ProviderTester.php | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f5d11b5e..c4552a3d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,6 +14,5 @@ - diff --git a/tests/Embera/ProviderTester.php b/tests/Embera/ProviderTester.php index 126d9c0e..ea5456ec 100755 --- a/tests/Embera/ProviderTester.php +++ b/tests/Embera/ProviderTester.php @@ -63,8 +63,12 @@ protected function getRandomDataFrom(array $data, $count = 1) */ protected function validateProvider($p, array $config = []) { - // Use all available valid urls? - $rounds = (defined('FULL_TEST') && FULL_TEST ? 1000 : 1); + $rounds = 1000; + $validateRealResponse = true; + if ((bool) getenv('TRAVIS')) { + $rounds = 1; + $validateRealResponse = false; + } if (empty($this->tasks)) { throw new \Exception(sprintf('The Provider %s doesnt have tasks', $p)); @@ -80,7 +84,9 @@ protected function validateProvider($p, array $config = []) $this->validateFakeResponse($p, $this->tasks, $rounds, $config); } - $this->validateRealResponse($p, $this->tasks, $rounds, $config); + if ($validateRealResponse) { + $this->validateRealResponse($p, $this->tasks, $rounds, $config); + } } /**