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