Files
oleibman 1388efb080 Drop Support for Php 8.1
This PR will be merged at the end of this month. As the README says, we maintain support for Php Versions for six months beyond their end of life. That time has now arrived for 8.1.
2026-06-08 09:15:57 -07:00

68 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpOffice\PhpSpreadsheetTests\Helper;
use Exception;
use PhpOffice\PhpSpreadsheet\Helper\Handler;
use PHPUnit\Framework\TestCase;
class HandlerTest extends TestCase
{
protected static bool $alwaysTrue = true;
public function testSuppressed(): void
{
self::assertSame(self::$alwaysTrue, Handler::suppressed());
}
public function testDeprecated(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/Invalid characters/');
Handler::deprecated();
}
public function testNotice(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/Timezone/');
Handler::notice('invalidtz');
}
public function testWarning(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/ailed to open stream/');
Handler::warning();
}
public function testUserDeprecated(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/hello/');
Handler::userDeprecated();
}
public function testUserNotice(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/userNotice/');
Handler::userNotice();
}
public function testUserWarning(): void
{
$this->expectException(Exception::class);
$this->expectExceptionMessageMatches('/userWarning/');
Handler::userWarning();
}
}