Skip to content

Commit

Permalink
Test real responses on local and not on travis.
Browse files Browse the repository at this point in the history
Its easier that way and avoid problems due to slow responses
from providers.
  • Loading branch information
mpratt committed Oct 27, 2020
1 parent cb29e8a commit 9d5a556
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 0 additions & 1 deletion phpunit.xml.dist
Expand Up @@ -14,6 +14,5 @@

<php>
<ini name="date.timezone" value="UTC"/>
<const name="FULL_TEST" value="false"/>
</php>
</phpunit>
12 changes: 9 additions & 3 deletions tests/Embera/ProviderTester.php
Expand Up @@ -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));
Expand All @@ -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);
}
}

/**
Expand Down

0 comments on commit 9d5a556

Please sign in to comment.