| 
									
										
										
										
											2012-11-29 23:57:12 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 17:18:12 +00:00
										 |  |  | namespace PhpOffice\PhpSpreadsheetTests\Worksheet; | 
					
						
							| 
									
										
										
										
											2015-05-30 11:25:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 17:18:12 +00:00
										 |  |  | use PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory; | 
					
						
							|  |  |  | use PhpOffice\PhpSpreadsheet\Spreadsheet; | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-30 11:25:17 +00:00
										 |  |  | class CellCollectionTest extends \PHPUnit_Framework_TestCase | 
					
						
							| 
									
										
										
										
											2012-11-29 23:57:12 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testCacheLastCell() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  |         $methods = CachedObjectStorageFactory::getCacheStorageMethods(); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         foreach ($methods as $method) { | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  |             CachedObjectStorageFactory::initialize($method); | 
					
						
							|  |  |  |             $workbook = new Spreadsheet(); | 
					
						
							| 
									
										
										
										
											2015-05-30 11:25:17 +00:00
										 |  |  |             $cells = ['A1', 'A2']; | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |             $worksheet = $workbook->getActiveSheet(); | 
					
						
							|  |  |  |             $worksheet->setCellValue('A1', 1); | 
					
						
							|  |  |  |             $worksheet->setCellValue('A2', 2); | 
					
						
							|  |  |  |             $this->assertEquals($cells, $worksheet->getCellCollection(), "Cache method \"$method\".");
 | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  |             CachedObjectStorageFactory::finalize(); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-11-29 23:57:12 +00:00
										 |  |  | } |