You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postfixadmin/tests/GeneratePasswordTest.php

29 lines
711 B
PHTML

7 years ago
<?php
require_once('common.php');
7 years ago
class GeneratePasswordTest extends PHPUnit_Framework_TestCase {
public function testBasic() {
7 years ago
$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));
7 years ago
}
}