| @@ 125-138 (lines=14) @@ | ||
| 122 | } |
|
| 123 | ||
| 124 | /** @test */ |
|
| 125 | public function smallAlphanumericFormatOnly() |
|
| 126 | {
|
|
| 127 | $pw = new Password(); |
|
| 128 | ||
| 129 | $pw->addFormat(new Formats\SmallAlphanumeric()); |
|
| 130 | ||
| 131 | $str = $pw->generate(); |
|
| 132 | ||
| 133 | $this->assertNotEmpty($str); |
|
| 134 | ||
| 135 | $this->assertEquals(15, mb_strlen($str)); |
|
| 136 | ||
| 137 | $this->assertRegExp('/[a-zA-Z0-9]/', $str);
|
|
| 138 | } |
|
| 139 | ||
| 140 | /** @test */ |
|
| 141 | public function strongAlphanumericFormatOnly() |
|
| @@ 141-154 (lines=14) @@ | ||
| 138 | } |
|
| 139 | ||
| 140 | /** @test */ |
|
| 141 | public function strongAlphanumericFormatOnly() |
|
| 142 | {
|
|
| 143 | $pw = new Password(); |
|
| 144 | ||
| 145 | $pw->addFormat(new Formats\StrongAlphanumeric()); |
|
| 146 | ||
| 147 | $str = $pw->generate(); |
|
| 148 | ||
| 149 | $this->assertNotEmpty($str); |
|
| 150 | ||
| 151 | $this->assertEquals(30, mb_strlen($str)); |
|
| 152 | ||
| 153 | $this->assertRegExp('/[a-zA-Z0-9]/', $str);
|
|
| 154 | } |
|
| 155 | ||
| 156 | /** @test */ |
|
| 157 | public function mixedStrongFormatOnly() |
|