mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
f8c970ec0c
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114499 467b73ca-7a2a-4603-9d3b-597d59a354a9
27 lines
695 B
PHP
27 lines
695 B
PHP
<?php
|
|
/**
|
|
* @package sapphire
|
|
* @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'));
|
|
}
|
|
|
|
} |