diff --git a/tests/lib/SimpleSAML/Utils/RandomTest.php b/tests/lib/SimpleSAML/Utils/RandomTest.php new file mode 100644 index 0000000000000000000000000000000000000000..fe82f3894e419cbb67a28e9df696150fa09cd679 --- /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())); + } +}