Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Update Generator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jul 12, 2015
1 parent 6615c01 commit 6ae1aa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Faker/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function seed($seed = null)
if ($seed === null) {
mt_srand();
} else {
mt_srand($seed);
mt_srand((int) $seed);
}
}

Expand Down
3 changes: 3 additions & 0 deletions test/Faker/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public function testSeed()
$this->assertNotEquals($mtRandWithSeedZero, $mtRandWithoutSeed, 'seed() should be different than seed(0)');
$generator->seed();
$this->assertNotEquals($mtRandWithoutSeed, mt_rand(), 'seed() should not be deterministic.');

$generator->seed('10');
$this->assertTrue(true, 'seeding with a non int value doesn\'t throw an exception');
}
}

Expand Down

0 comments on commit 6ae1aa2

Please sign in to comment.