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

Commit

Permalink
Merge pull request #632 from theofidry/patch-1
Browse files Browse the repository at this point in the history
Update Generator.php
  • Loading branch information
fzaninotto committed Jul 15, 2015
2 parents 587a38f + 6ae1aa2 commit b1abe41
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 b1abe41

Please sign in to comment.