GeneratePasswordTest.php 683 B

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