2019-12-24 01:52:07 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-07-16 18:13:12 +02:00
|
|
|
namespace Psl\Tests\SecureRandom;
|
2019-12-24 01:52:07 +01:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2020-07-16 18:13:12 +02:00
|
|
|
use Psl\SecureRandom;
|
2019-12-24 01:52:07 +01:00
|
|
|
|
2020-10-15 10:18:03 +02:00
|
|
|
final class FloatTest extends TestCase
|
2019-12-24 01:52:07 +01:00
|
|
|
{
|
2019-12-25 19:11:35 +01:00
|
|
|
public function testFloat(): void
|
|
|
|
{
|
2020-07-16 18:13:12 +02:00
|
|
|
$random = SecureRandom\float();
|
2019-12-25 19:11:35 +01:00
|
|
|
|
2020-10-15 10:18:03 +02:00
|
|
|
static::assertIsFloat($random);
|
|
|
|
static::assertGreaterThanOrEqual(0, $random);
|
|
|
|
static::assertLessThanOrEqual(1, $random);
|
2019-12-25 19:11:35 +01:00
|
|
|
}
|
2019-12-24 01:52:07 +01:00
|
|
|
}
|