Skip to content

Commit c16eaeb

Browse files
committed
Coverage Tweaks
See if we can satisfy Scrutinizer.
1 parent f1ce95e commit c16eaeb

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

tests/PhpSpreadsheetTests/Reader/Ods/DefinedNamesTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace PhpOffice\PhpSpreadsheetTests\Reader\Ods;
66

7-
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
87
use PhpOffice\PhpSpreadsheet\Reader\Ods;
98
use PHPUnit\Framework\TestCase;
109

@@ -15,10 +14,7 @@ public function testDefinedNamesValue(): void
1514
$filename = 'tests/data/Reader/Ods/DefinedNames.ods';
1615
$reader = new Ods();
1716
$spreadsheet = $reader->load($filename);
18-
$calculation = Calculation::getInstance($spreadsheet);
19-
$calculation->setInstanceArrayReturnType(
20-
Calculation::RETURN_ARRAY_AS_VALUE
21-
);
17+
$spreadsheet->returnArrayAsValue();
2218
$worksheet = $spreadsheet->getActiveSheet();
2319

2420
$firstDefinedNameValue = $worksheet->getCell('First')->getValue();
@@ -36,10 +32,7 @@ public function testDefinedNamesApostropheValue(): void
3632
$filename = 'tests/data/Reader/Ods/DefinedNames.apostrophe.ods';
3733
$reader = new Ods();
3834
$spreadsheet = $reader->load($filename);
39-
$calculation = Calculation::getInstance($spreadsheet);
40-
$calculation->setInstanceArrayReturnType(
41-
Calculation::RETURN_ARRAY_AS_VALUE
42-
);
35+
$spreadsheet->returnArrayAsValue();
4336
$worksheet = $spreadsheet->getActiveSheet();
4437
self::assertSame("apo'strophe", $worksheet->getTitle());
4538

@@ -58,10 +51,7 @@ public function testDefinedNamesArray(): void
5851
$filename = 'tests/data/Reader/Ods/DefinedNames.ods';
5952
$reader = new Ods();
6053
$spreadsheet = $reader->load($filename);
61-
$calculation = Calculation::getInstance($spreadsheet);
62-
$calculation->setInstanceArrayReturnType(
63-
Calculation::RETURN_ARRAY_AS_ARRAY
64-
);
54+
$spreadsheet->returnArrayAsArray();
6555
$worksheet = $spreadsheet->getActiveSheet();
6656

6757
$firstDefinedNameValue = $worksheet->getCell('First')->getValue();

tests/PhpSpreadsheetTests/Shared/DateTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,15 @@ public function testSetExcelCalendar(): void
3939
Date::CALENDAR_WINDOWS_1900,
4040
];
4141

42+
$spreadsheet = new Spreadsheet();
4243
foreach ($calendarValues as $calendarValue) {
4344
$result = Date::setExcelCalendar($calendarValue);
4445
self::assertTrue($result);
46+
$result = $spreadsheet->setExcelCalendar($calendarValue);
47+
self::assertTrue($result);
4548
}
49+
self::assertFalse($spreadsheet->setExcelCalendar(0));
50+
$spreadsheet->disconnectWorksheets();
4651
}
4752

4853
public function testSetExcelCalendarWithInvalidValue(): void

0 commit comments

Comments
 (0)