mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
30 lines
691 B
PHP
30 lines
691 B
PHP
<?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));
|
|
}
|
|
}
|