CellCollectionTest.php 937 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class CellCollectionTest extends PHPUnit_Framework_TestCase
  3. {
  4. public function setUp()
  5. {
  6. if (!defined('PHPEXCEL_ROOT')) {
  7. define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
  8. }
  9. require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
  10. }
  11. public function testCacheLastCell()
  12. {
  13. $methods = PHPExcel_CachedObjectStorageFactory::getCacheStorageMethods();
  14. foreach ($methods as $method) {
  15. PHPExcel_CachedObjectStorageFactory::initialize($method);
  16. $workbook = new PHPExcel();
  17. $cells = array('A1', 'A2');
  18. $worksheet = $workbook->getActiveSheet();
  19. $worksheet->setCellValue('A1', 1);
  20. $worksheet->setCellValue('A2', 2);
  21. $this->assertEquals($cells, $worksheet->getCellCollection(), "Cache method \"$method\".");
  22. PHPExcel_CachedObjectStorageFactory::finalize();
  23. }
  24. }
  25. }