/** * @param string $key * @param mixed $value * @dataProvider saveProvider */ public function testHasKey($key, $value) { $fileCache = new FileCache($this->getTempPath(), $this->filemanager); $fileCache->save($key, $value); $this->assertTrue($fileCache->hasKey($key)); }
/** * Test hasKey method */ public function testHasKey() { $this->setDir(); $this->getDir(); $this->directoryMock->freeze(); $this->filemanagerMock->fileExists($this->getCachedFilePath())->once()->andReturn(true); $this->filemanagerMock->freeze(); $fileCache = new FileCache(self::PATH, $this->filemanagerMock); $this->assertTrue($fileCache->hasKey(self::KEY)); $this->directoryMock->assertExpectations(); $this->filemanagerMock->assertExpectations(); }