PhpSpreadsheet/tests/PhpSpreadsheetTests/Worksheet/CellCollectionTest.php

25 lines
841 B
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
2015-05-30 11:25:17 +00:00
use PhpOffice\PhpSpreadsheet\CachedObjectStorageFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
2015-05-30 11:25:17 +00:00
class CellCollectionTest extends \PHPUnit_Framework_TestCase
{
2015-05-17 13:00:02 +00:00
public function testCacheLastCell()
{
$methods = CachedObjectStorageFactory::getCacheStorageMethods();
2015-05-17 13:00:02 +00:00
foreach ($methods as $method) {
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\".");
CachedObjectStorageFactory::finalize();
2015-05-17 13:00:02 +00:00
}
}
}