Commit e714dc4d authored by Korko's avatar Korko
Browse files

Protect from srand disabled

parent 9af41332
......@@ -57,6 +57,15 @@ class SolverTest extends TestCase
public function testOne()
{
srand(1);
$rand1 = rand(0, 10);
srand(1);
$rand2 = rand(0, 10);
if ($rand1 !== $rand2) {
$this->markTestSkipped('srand disabled');
return;
}
srand(1);
$this->assertEquals([0 => 1, 1 => 2, 2 => 0], Solver::one(['A', 'B', 'C']));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment