Skip to content

Commit 0f52285

Browse files
authored
Merge pull request #50 from programmatordev/OPA-54-fix-cache-test
Fix abstract endpoint with cache enabled test
2 parents 359443f + 35e2f88 commit 0f52285

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"php-http/client-common": "^2.7",
1818
"php-http/discovery": "^1.18",
1919
"php-http/logger-plugin": "^1.3",
20-
"programmatordev/yet-another-php-validator": "^0.2",
20+
"programmatordev/yet-another-php-validator": "^0.4",
2121
"psr/cache": "^2.0 || ^3.0",
2222
"psr/http-client": "^1.0",
2323
"psr/http-factory": "^1.0",

tests/AbstractEndpointTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Nyholm\Psr7\Response;
66
use ProgrammatorDev\OpenWeatherMap\Endpoint\AbstractEndpoint;
77
use ProgrammatorDev\OpenWeatherMap\OpenWeatherMap;
8+
use Psr\Cache\CacheItemInterface;
89
use Psr\Cache\CacheItemPoolInterface;
910
use Psr\Log\LoggerInterface;
1011

@@ -17,6 +18,10 @@ public function testAbstractEndpointWithCache()
1718
);
1819

1920
$cache = $this->createMock(CacheItemPoolInterface::class);
21+
$cache->method('getItem')->willReturn(
22+
$this->createMock(CacheItemInterface::class)
23+
);
24+
2025
$cache->expects($this->once())->method('save');
2126

2227
$api = $this->givenApi();

0 commit comments

Comments
 (0)