mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-24 04:03:01 +08:00
23 lines
500 B
PHP
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);
|
|
}
|
|
}
|