|
@@ 89-102 (lines=14) @@
|
| 86 |
|
}
|
| 87 |
|
|
| 88 |
|
/** @test */
|
| 89 |
|
public function specialCharacterOnly()
|
| 90 |
|
{
|
| 91 |
|
$pw = new Password();
|
| 92 |
|
|
| 93 |
|
$pw->addCriteria(new Criterias\SpecialCharacter(), new Occurences\Strict(5));
|
| 94 |
|
|
| 95 |
|
$str = $pw->generate();
|
| 96 |
|
|
| 97 |
|
$this->assertNotEmpty($str);
|
| 98 |
|
|
| 99 |
|
$this->assertEquals(5, mb_strlen($str));
|
| 100 |
|
|
| 101 |
|
$this->assertRegExp('/[\[\&\+\#\|\^\°\=\!\@\%\*\?\_\~\-\§\:\;\.\]]{5}/', $str);
|
| 102 |
|
}
|
| 103 |
|
|
| 104 |
|
/** @test */
|
| 105 |
|
public function longDigitFormatOnly()
|
|
@@ 119-132 (lines=14) @@
|
| 116 |
|
}
|
| 117 |
|
|
| 118 |
|
/** @test */
|
| 119 |
|
public function smallAlphanumericFormatOnly()
|
| 120 |
|
{
|
| 121 |
|
$pw = new Password();
|
| 122 |
|
|
| 123 |
|
$pw->addFormat(new Formats\SmallAlphanumeric());
|
| 124 |
|
|
| 125 |
|
$str = $pw->generate();
|
| 126 |
|
|
| 127 |
|
$this->assertNotEmpty($str);
|
| 128 |
|
|
| 129 |
|
$this->assertEquals(15, mb_strlen($str));
|
| 130 |
|
|
| 131 |
|
$this->assertRegExp('/[a-zA-Z0-9]/', $str);
|
| 132 |
|
}
|
| 133 |
|
|
| 134 |
|
/** @test */
|
| 135 |
|
public function strongAlphanumericFormatOnly()
|
|
@@ 135-148 (lines=14) @@
|
| 132 |
|
}
|
| 133 |
|
|
| 134 |
|
/** @test */
|
| 135 |
|
public function strongAlphanumericFormatOnly()
|
| 136 |
|
{
|
| 137 |
|
$pw = new Password();
|
| 138 |
|
|
| 139 |
|
$pw->addFormat(new Formats\StrongAlphanumeric());
|
| 140 |
|
|
| 141 |
|
$str = $pw->generate();
|
| 142 |
|
|
| 143 |
|
$this->assertNotEmpty($str);
|
| 144 |
|
|
| 145 |
|
$this->assertEquals(30, mb_strlen($str));
|
| 146 |
|
|
| 147 |
|
$this->assertRegExp('/[a-zA-Z0-9]/', $str);
|
| 148 |
|
}
|
| 149 |
|
|
| 150 |
|
/** @test */
|
| 151 |
|
public function mixedStrongFormatOnly()
|