diff --git a/tests/MobileDetectWithCacheTest.php b/tests/MobileDetectWithCacheTest.php index 02d8c270..e0e7b5ab 100644 --- a/tests/MobileDetectWithCacheTest.php +++ b/tests/MobileDetectWithCacheTest.php @@ -129,6 +129,9 @@ public function testCustomCacheWithInvalidFnThrowsException() $detect->isMobile(); } + /** + * @throws MobileDetectException + */ public function testCustomCacheForConsecutiveCalls() { $cache = new Cache(); @@ -143,6 +146,9 @@ public function testCustomCacheForConsecutiveCalls() $this->assertCount(1, $cache->getKeys()); } + /** + * @throws MobileDetectException + */ public function testGetCacheKeyIsUsedInConsecutiveCallsIfFoundIn() { $cache = $this->getMockBuilder(Cache::class) @@ -151,12 +157,9 @@ public function testGetCacheKeyIsUsedInConsecutiveCallsIfFoundIn() $cache->method('get')->withAnyParameters()->willReturn(new CacheItem('name', 'value')); $cache->method('set')->withAnyParameters()->willReturn(true); - $cache->expects($spy = $this->exactly(2))->method('get'); $cache->expects($spy = $this->never())->method('set'); - - $detect = new MobileDetect($cache); $detect->setUserAgent('iPad; AppleWebKit/533.17.9 Version/5.0.2 Mobile/8C148 Safari/6533.18.5');