Files
PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/ArrayTest.php
T
Jonathan Goode e460c82606 Fully flatten an array (#2956)
* Fully flatten an array

* Provide test coverage for CONCAT combined with INDEX/MATCH
2022-07-27 19:29:02 -07:00

35 lines
769 B
PHP

<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PHPUnit\Framework\TestCase;
class ArrayTest extends TestCase
{
public function testMultiDimensionalArrayIsFlattened(): void
{
$array = [
0 => [
0 => [
32 => [
'B' => 'PHP',
],
],
],
1 => [
0 => [
32 => [
'C' => 'Spreadsheet',
],
],
],
];
$values = Functions::flattenArray($array);
self::assertIsNotArray($values[0]);
self::assertIsNotArray($values[1]);
}
}