| @@ 26-35 (lines=10) @@ | ||
| 23 | $this->assertFalse($foo->isOK()); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testGetRandMaximum() |
|
| 27 | { |
|
| 28 | $type = new TSchemaType(); |
|
| 29 | $expectedMax = 1; |
|
| 30 | $actualMax = -2; |
|
| 31 | for ($i = 0; $i < 100; $i++) { |
|
| 32 | $actualMax = max($type->getRand(), $actualMax); |
|
| 33 | } |
|
| 34 | $this->assertTrue($expectedMax >= $actualMax, $actualMax . " must be less than ".$expectedMax); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function testGetRandMinimum() |
|
| 38 | { |
|
| @@ 37-46 (lines=10) @@ | ||
| 34 | $this->assertTrue($expectedMax >= $actualMax, $actualMax . " must be less than ".$expectedMax); |
|
| 35 | } |
|
| 36 | ||
| 37 | public function testGetRandMinimum() |
|
| 38 | { |
|
| 39 | $type = new TSchemaType(); |
|
| 40 | $expectedMin = 0; |
|
| 41 | $actualMin = 2; |
|
| 42 | for ($i = 0; $i < 100; $i++) { |
|
| 43 | $actualMin = min($type->getRand(), $actualMin); |
|
| 44 | } |
|
| 45 | $this->assertTrue($expectedMin <= $actualMin, $actualMin . " must be less than ".$expectedMin); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||