mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-10-22 17:05:50 +02:00
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'));
|
||
|
}
|
||
|
|
||
|
}
|