File: GeneratePasswordTest.php

package info (click to toggle)
postfixadmin 4.0.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,888 kB
  • sloc: php: 12,256; perl: 1,156; sh: 717; python: 142; xml: 63; sql: 3; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
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
27
28
29
<?php

class GeneratePasswordTest extends \PHPUnit\Framework\TestCase
{
    public function testBasic()
    {
        $one = generate_password();

        $two = generate_password();

        $this->assertNotEquals($one, $two);
        $this->assertNotEmpty($one);
        $this->assertNotEmpty($two);
        $this->assertEquals(12, strlen($one));
    }

    public function testLength()
    {
        $one = generate_password(1);

        $ten = generate_password(10);

        $this->assertNotEquals($one, $ten);
        $this->assertNotEmpty($one);
        $this->assertNotEmpty($ten);
        $this->assertEquals(10, strlen($ten));
        $this->assertEquals(1, strlen($one));
    }
}