Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function testGenerate($length, $not) { |
||
33 | $rand = new URandom; |
||
34 | $stub = $rand->generate($length); |
||
35 | $this->assertEquals($length, strlen($stub)); |
||
36 | if (file_exists('/dev/urandom')) { |
||
37 | $this->assertNotEquals($not, $stub); |
||
38 | } else { |
||
39 | $this->assertEquals(str_repeat(chr(0), $length), $stub); |
||
40 | } |
||
41 | } |
||
42 | |||
44 |