Files
php-uuid/tests/Generator/RandomGeneratorFactoryTest.php
T
2015-07-22 21:34:15 +00:00

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);
}
}