Files
php-uuid/tests/RandomGeneratorFactoryTest.php
T
2014-10-30 15:16:59 +01:00

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