Add IDE autocompletion support and Type helper methods

This commit is contained in:
Younes ENNAJI
2026-03-02 05:13:28 +00:00
parent d4abef58eb
commit 0d25c72743
7 changed files with 225 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Flasher\Tests\Prime\Notification;
use Flasher\Prime\Notification\Type;
use PHPUnit\Framework\TestCase;
final class TypeTest extends TestCase
{
public function testConstants(): void
{
$this->assertSame('success', Type::SUCCESS);
$this->assertSame('error', Type::ERROR);
$this->assertSame('info', Type::INFO);
$this->assertSame('warning', Type::WARNING);
}
public function testAll(): void
{
$expected = ['success', 'error', 'info', 'warning'];
$this->assertSame($expected, Type::all());
}
public function testIsValidWithValidTypes(): void
{
$this->assertTrue(Type::isValid('success'));
$this->assertTrue(Type::isValid('error'));
$this->assertTrue(Type::isValid('info'));
$this->assertTrue(Type::isValid('warning'));
}
public function testIsValidWithInvalidTypes(): void
{
$this->assertFalse(Type::isValid('invalid'));
$this->assertFalse(Type::isValid(''));
$this->assertFalse(Type::isValid('SUCCESS'));
$this->assertFalse(Type::isValid('notice'));
}
}