mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-30 20:18:00 +00:00
1388efb080
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.
68 lines
1.6 KiB
PHP
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();
|
|
}
|
|
}
|