mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-09 03:01:18 +02:00
28 lines
697 B
PHP
28 lines
697 B
PHP
<?php
|
|
/**
|
|
* @package framework
|
|
* @subpackage tests
|
|
* @author Ingo Schommer
|
|
*/
|
|
class RandomGeneratorTest extends SapphireTest {
|
|
|
|
function testGenerateEntropy() {
|
|
$r = new RandomGenerator();
|
|
$this->assertNotNull($r->generateEntropy());
|
|
$this->assertNotEquals($r->generateEntropy(), $r->generateEntropy());
|
|
}
|
|
|
|
function testGenerateHash() {
|
|
$r = new RandomGenerator();
|
|
$this->assertNotNull($r->generateHash());
|
|
$this->assertNotEquals($r->generateHash(), $r->generateHash());
|
|
}
|
|
|
|
function testGenerateHashWithAlgorithm() {
|
|
$r = new RandomGenerator();
|
|
$this->assertNotNull($r->generateHash('md5'));
|
|
$this->assertNotEquals($r->generateHash(), $r->generateHash('md5'));
|
|
}
|
|
|
|
}
|