summaryrefslogtreecommitdiffstats
path: root/tests/lib/SimpleSAML/Utils/RandomTest.php
blob: 9f2f6381be6a1a5852810140073d1202e361423b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace SimpleSAML\Test\Utils;

use SimpleSAML\Utils\Random;

/**
 * Tests for SimpleSAML\Utils\Random.
 */
class RandomTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Test for SimpleSAML\Utils\Random::generateID().
     *
     * @covers SimpleSAML\Utils\Random::generateID
     */
    public function testGenerateID()
    {
        // check that it always starts with an underscore
        $this->assertStringStartsWith('_', Random::generateID());

        // check the length
        $this->assertEquals(Random::ID_LENGTH, strlen(Random::generateID()));
    }
}