Move RandomGeneratorInterface and RandomGeneratorFactory to Generator NS

This commit is contained in:
Ben Ramsey
2015-07-16 09:54:04 -05:00
parent e006f669ad
commit b3ef99a2e9
10 changed files with 9 additions and 13 deletions
@@ -0,0 +1,26 @@
<?php
namespace Ramsey\Uuid\Generator;
use Ramsey\Uuid\TestCase;
class RandomGeneratorFactoryTest extends TestCase
{
public function testFactoryReturnsNonOpenSslGeneratorWithForceNoOpenSsl()
{
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);
}
}