/** * Test save method with file write failed exception */ public function testSaveFileWriteFailed() { $this->memoryCacheMock->save(self::KEY, self::VALUE)->once(); $this->memoryCacheMock->freeze(); $fileWriteFailedException = new FileWriteFailedException(); $this->fileCacheMock->save(self::KEY, self::VALUE)->once()->andThrow($fileWriteFailedException); $this->fileCacheMock->freeze(); $smartCache = new SmartCache($this->fileCacheMock, $this->memoryCacheMock); $this->setExpectedException('Hadamcik\\SmartCache\\Utils\\Filemanager\\FileWriteFailedException'); $smartCache->save(self::KEY, self::VALUE); }
/** * Test save method */ public function testSave() { $this->smartCache->save(self::KEY, self::VALUE); }