diff --git a/src/Feeds/Fetcher/HttpFetcher.php b/src/Feeds/Fetcher/HttpFetcher.php index bc15a15b..62c3ca63 100644 --- a/src/Feeds/Fetcher/HttpFetcher.php +++ b/src/Feeds/Fetcher/HttpFetcher.php @@ -100,6 +100,7 @@ class HttpFetcher extends PluginBase implements ClearableInterface, FetcherInter $sink = $this->fileSystem->realpath($sink); try { + // Get cache key if caching is enabled. $cache_key = $this->useCache() ? $this->getCacheKey($feed) : FALSE; $response = $this->get($feed->getSource(), $sink, $cache_key); } diff --git a/tests/src/Unit/Feeds/Fetcher/HttpFetcherTest.php b/tests/src/Unit/Feeds/Fetcher/HttpFetcherTest.php index 3358b9ef..d5b23615 100644 --- a/tests/src/Unit/Feeds/Fetcher/HttpFetcherTest.php +++ b/tests/src/Unit/Feeds/Fetcher/HttpFetcherTest.php @@ -68,6 +68,9 @@ class HttpFetcherTest extends FeedsUnitTestCase { $file_system->realpath(Argument::type('string'))->will(function ($args) { return realpath($args[0]); }); + $file_system->unlink(Argument::type('string'))->will(function ($args) { + return TRUE; + }); $this->fetcher = new HttpFetcher(['feed_type' => $feed_type], 'http', [], $client, $cache, $file_system->reveal()); $this->fetcher->setStringTranslation($this->getStringTranslationStub());