/** * @param int $extraLifeTime * @param \PHPUnit_Framework_Constraint $constraint * @dataProvider touchDataProvider */ public function testTouch($extraLifeTime, \PHPUnit_Framework_Constraint $constraint) { $cacheId = 'test'; $this->_model->save('test data', $cacheId, [], 2); $this->assertGreaterThan(0, $this->_model->test($cacheId), "Cache with id '{$cacheId}' has not been saved"); $this->_model->touch($cacheId, $extraLifeTime); sleep(2); $this->assertThat($this->_model->test($cacheId), $constraint); }
public function testTouch() { $cacheId = 'test'; $this->_collection->expects($this->once())->method('update')->with($this->arrayHasKey('_id')); $this->_model->touch($cacheId, 100); }