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

GeneratePasswordTest.php 711B

12345678910111213141516171819202122232425262728
  1. <?php
  2. require_once('common.php');
  3. class GeneratePasswordTest extends PHPUnit_Framework_TestCase {
  4. public function testBasic() {
  5. $one = generate_password();
  6. $two = generate_password();
  7. $this->assertNotEquals($one, $two);
  8. $this->assertNotEmpty($one);
  9. $this->assertNotEmpty($two);
  10. $this->assertEquals(12, strlen($one));
  11. }
  12. public function testLength() {
  13. $one = generate_password(1);
  14. $ten = generate_password(10);
  15. $this->assertNotEquals($one, $ten);
  16. $this->assertNotEmpty($one);
  17. $this->assertNotEmpty($ten);
  18. $this->assertEquals(10, strlen($ten));
  19. $this->assertEquals(1, strlen($one));
  20. }
  21. }