mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-22 09:23:40 +00:00
ec4098c8fd
While we might never be able to have 100% of our code strict, we can at the very least do it for all of our tests. This ensures that our tests are using our API with the types as intended by the test author, and not silently be cast to what our API requires.
31 lines
856 B
PHP
31 lines
856 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Worksheet;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Iterator;
|
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class IteratorTest extends TestCase
|
|
{
|
|
public function testIteratorFullRange(): void
|
|
{
|
|
$spreadsheet = new Spreadsheet();
|
|
$spreadsheet->createSheet();
|
|
$spreadsheet->createSheet();
|
|
|
|
$iterator = new Iterator($spreadsheet);
|
|
$columnIndexResult = 0;
|
|
self::assertEquals($columnIndexResult, $iterator->key());
|
|
|
|
foreach ($iterator as $key => $column) {
|
|
self::assertEquals($columnIndexResult++, $key);
|
|
self::assertInstanceOf(Worksheet::class, $column);
|
|
}
|
|
self::assertSame(3, $columnIndexResult);
|
|
}
|
|
}
|