Skip to content

Commit d7f1d3c

Browse files
committed
Fix cache dir check to handle boolean true from PHPUnit
PHPUnit converts XML attribute value='true' to boolean true instead of string 'true', causing the cache dir check to fail and tests to make real API calls instead of using cached responses.
1 parent 8de527b commit d7f1d3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Provider/Geonames/Tests/GeonamesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class GeonamesTest extends BaseTestCase
2424
{
2525
protected function getCacheDir(): ?string
2626
{
27-
if (isset($_SERVER['USE_CACHED_RESPONSES']) && 'true' === $_SERVER['USE_CACHED_RESPONSES']) {
27+
if (isset($_SERVER['USE_CACHED_RESPONSES']) && ($_SERVER['USE_CACHED_RESPONSES'] === true || $_SERVER['USE_CACHED_RESPONSES'] === 'true')) {
2828
return __DIR__.'/.cached_responses';
2929
}
3030

0 commit comments

Comments
 (0)