您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }