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