public function testGetData() { //Trying to get data we know is present $file_name = $this->getFileName(); setOutputDestination($file_name); $stamp = 'Laika, primul călător în cosmos'; file_put_contents($file_name, json_encode($stamp)); $data = $this->file_cache->getData($this->test_file_name); $this->assertEquals($stamp, $data); resetOutputDestination($file_name); //Trying to get data when the file is not there $data = $this->file_cache->getData($this->test_file_name); $this->assertFalse($data); }
/** * Removes a site from the sites cache * * @param string $sitename Name of site to remove from array * @return void */ public function remove($sitename) { $cache = (array) $this->cache->getData($this->cachekey, array('decode_array' => true)); unset($cache[$sitename]); $this->cache->putData($this->cachekey, $cache); }