public function testCacheLastCell() { $methods = PHPExcel_CachedObjectStorageFactory::getCacheStorageMethods(); foreach ($methods as $method) { PHPExcel_CachedObjectStorageFactory::initialize($method); $workbook = new PHPExcel(); $cells = array('A1', 'A2'); $worksheet = $workbook->getActiveSheet(); $worksheet->setCellValue('A1', 1); $worksheet->setCellValue('A2', 2); $this->assertEquals($cells, $worksheet->getCellCollection(), "Cache method \"{$method}\"."); PHPExcel_CachedObjectStorageFactory::finalize(); } }
/** * Set the method that should be used for cell cacheing * * @param string $method Name of the cacheing method * @param array $arguments Optional configuration arguments for the cacheing method * @return boolean Success or failure */ public static function setCacheStorageMethod($method = PHPExcel_CachedObjectStorageFactory::cache_in_memory, $arguments = array()) { return PHPExcel_CachedObjectStorageFactory::initialize($method, $arguments); }