mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-14 15:56:48 +03:00
28 lines
805 B
PHP
28 lines
805 B
PHP
<?php
|
|
|
|
namespace Ramsey\Uuid\Generator;
|
|
|
|
use Ramsey\Uuid\TestCase;
|
|
|
|
class RandomGeneratorFactoryTest extends TestCase
|
|
{
|
|
public function testFactoryReturnsNonOpenSslGeneratorWithForceNoOpenSsl()
|
|
{
|
|
RandomGeneratorFactory::$forceNoRandomBytes = true;
|
|
RandomGeneratorFactory::$forceNoOpensslRandomPseudoBytes = true;
|
|
|
|
$generator = RandomGeneratorFactory::getGenerator();
|
|
|
|
$this->assertNotInstanceOf('\Ramsey\Uuid\Generator\OpenSslGenerator', $generator);
|
|
}
|
|
|
|
public function testFactoryReturnsOpenSslGeneratorIfAvailable()
|
|
{
|
|
RandomGeneratorFactory::$forceNoOpensslRandomPseudoBytes = false;
|
|
|
|
$generator = RandomGeneratorFactory::getGenerator();
|
|
|
|
$this->assertInstanceOf('\Ramsey\Uuid\Generator\OpenSslGenerator', $generator);
|
|
}
|
|
}
|