-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Null Passed to AutoFilter SetRange (#2454)
* Null Passed to AutoFilter SetRange Fix #2281. Delete auto filter set range to null, but should set it to null string. This causes a deprecation warning in Php8.1. * Constructor Call Also Sets Range to Null Should set it to null string.
- Loading branch information
Showing
4 changed files
with
22 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/PhpSpreadsheetTests/Worksheet/AutoFilter/DeleteAutoFilterTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace PhpOffice\PhpSpreadsheetTests\Worksheet\AutoFilter; | ||
|
||
class DeleteAutoFilterTest extends SetupTeardown | ||
{ | ||
public function testDelete(): void | ||
{ | ||
// Issue 2281 - deprecation in PHP81 when deleting filter | ||
$sheet = $this->getSheet(); | ||
$autoFilter = $sheet->getAutoFilter(); | ||
$autoFilter->setRange('H2:O256'); | ||
$sheet->removeAutoFilter(); | ||
self::assertSame('', $sheet->getAutoFilter()->getRange()); | ||
} | ||
} |