v-wordpress-plugin-updater/tests/SecureRandomHelperTest.php
2026-04-06 09:47:05 -04:00

23 lines
500 B
PHP

<?php
declare(strict_types=1);
use App\Helpers\EncryptionHelper;
use PHPUnit\Framework\TestCase;
final class SecureRandomHelperTest extends TestCase
{
public function testBytesReturnsRequestedLength(): void
{
$bytes = EncryptionHelper::bytes(32);
self::assertSame(32, strlen($bytes));
}
public function testBytesThrowsForNonPositiveLength(): void
{
$this->expectException(InvalidArgumentException::class);
EncryptionHelper::bytes(0);
}
}