summaryrefslogtreecommitdiffstats
path: root/tests/lib/SimpleSAML/Utils/RandomTest.php
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2015-05-27 22:19:11 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2015-05-27 22:19:11 +0200
commita12bbb153054f46b3ff1f6beabb9d0d8182cb849 (patch)
tree6d526b197d390ca2848ddd6779ce7190d6d1bdcd /tests/lib/SimpleSAML/Utils/RandomTest.php
parent2566f123c68481e46d1d26f1ed8895f443cf95a9 (diff)
downloadsimplesamlphp-a12bbb153054f46b3ff1f6beabb9d0d8182cb849.zip
simplesamlphp-a12bbb153054f46b3ff1f6beabb9d0d8182cb849.tar.gz
simplesamlphp-a12bbb153054f46b3ff1f6beabb9d0d8182cb849.tar.bz2
Add tests for SimpleSAML\Utils\Random.
Diffstat (limited to 'tests/lib/SimpleSAML/Utils/RandomTest.php')
-rw-r--r--tests/lib/SimpleSAML/Utils/RandomTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/SimpleSAML/Utils/RandomTest.php b/tests/lib/SimpleSAML/Utils/RandomTest.php
new file mode 100644
index 0000000..fe82f38
--- /dev/null
+++ b/tests/lib/SimpleSAML/Utils/RandomTest.php
@@ -0,0 +1,18 @@
+<?php
+
+
+/**
+ * Tests for SimpleSAML\Utils\Random.
+ */
+class RandomTest extends PHPUnit_Framework_TestCase
+{
+
+ public function testGenerateID()
+ {
+ // check that it always starts with an underscore
+ $this->assertStringStartsWith('_', SimpleSAML\Utils\Random::generateID());
+
+ // check the length
+ $this->assertEquals(SimpleSAML\Utils\Random::ID_LENGTH, strlen(SimpleSAML\Utils\Random::generateID()));
+ }
+}