Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table; ..
Decoded Output download
<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table;
use PhpOffice\PhpSpreadsheet\Worksheet\Table;
class Issue3659Test extends SetupTeardown
{
public function testTableOnOtherSheet(): void
{
$spreadsheet = $this->getSpreadsheet();
$sheet = $this->getSheet();
$sheet->setTitle('Feuil1');
$tableSheet = $spreadsheet->createSheet();
$tableSheet->setTitle('sheet_with_table');
$tableSheet->fromArray(
[
['MyCol', 'Colonne2', 'Colonne3'],
[10, 20],
[2],
[3],
[4],
],
null,
'B1',
true
);
$table = new Table('B1:D5', 'Tableau1');
$tableSheet->addTable($table);
$sheet->setSelectedCells('F7');
$tableSheet->setSelectedCells('F8');
self::assertSame($sheet, $spreadsheet->getActiveSheet());
$sheet->getCell('A1')->setValue('=SUM(Tableau1[MyCol])');
$sheet->getCell('A2')->setValue('=SUM(Tableau1[])');
$sheet->getCell('A3')->setValue('=SUM(Tableau1)');
$sheet->getCell('A4')->setValue('=CONCAT(Tableau1)');
self::assertSame(19, $sheet->getCell('A1')->getCalculatedValue());
self::assertSame(39, $sheet->getCell('A2')->getCalculatedValue());
self::assertSame(39, $sheet->getCell('A3')->getCalculatedValue());
self::assertSame('1020234', $sheet->getCell('A4')->getCalculatedValue(), 'Header row not included');
self::assertSame('F7', $sheet->getSelectedCells());
self::assertSame('F8', $tableSheet->getSelectedCells());
self::assertSame($sheet, $spreadsheet->getActiveSheet());
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Worksheet\Table;
use PhpOffice\PhpSpreadsheet\Worksheet\Table;
class Issue3659Test extends SetupTeardown
{
public function testTableOnOtherSheet(): void
{
$spreadsheet = $this->getSpreadsheet();
$sheet = $this->getSheet();
$sheet->setTitle('Feuil1');
$tableSheet = $spreadsheet->createSheet();
$tableSheet->setTitle('sheet_with_table');
$tableSheet->fromArray(
[
['MyCol', 'Colonne2', 'Colonne3'],
[10, 20],
[2],
[3],
[4],
],
null,
'B1',
true
);
$table = new Table('B1:D5', 'Tableau1');
$tableSheet->addTable($table);
$sheet->setSelectedCells('F7');
$tableSheet->setSelectedCells('F8');
self::assertSame($sheet, $spreadsheet->getActiveSheet());
$sheet->getCell('A1')->setValue('=SUM(Tableau1[MyCol])');
$sheet->getCell('A2')->setValue('=SUM(Tableau1[])');
$sheet->getCell('A3')->setValue('=SUM(Tableau1)');
$sheet->getCell('A4')->setValue('=CONCAT(Tableau1)');
self::assertSame(19, $sheet->getCell('A1')->getCalculatedValue());
self::assertSame(39, $sheet->getCell('A2')->getCalculatedValue());
self::assertSame(39, $sheet->getCell('A3')->getCalculatedValue());
self::assertSame('1020234', $sheet->getCell('A4')->getCalculatedValue(), 'Header row not included');
self::assertSame('F7', $sheet->getSelectedCells());
self::assertSame('F8', $tableSheet->getSelectedCells());
self::assertSame($sheet, $spreadsheet->getActiveSheet());
}
}
Function Calls
None |
Stats
MD5 | 7f71f5ed98983593116a222bb6d7cff9 |
Eval Count | 0 |
Decode Time | 90 ms |