Issue #2443655 by daffie, bzrudi71: PostgreSQL: Fix system\Tests\Entity\EntityReferenceFieldTest

8.0.x
webchick 2015-03-12 02:56:21 -07:00
parent c069f5f91e
commit 501409f389
1 changed files with 4 additions and 1 deletions

View File

@ -188,7 +188,10 @@ abstract class EntityUnitTestBase extends KernelTestBase {
protected function generateRandomEntityId($string = FALSE) {
srand(time());
do {
$id = $string ? $this->randomMachineName() : mt_rand(1, 0xFFFFFFFF);
// 0x7FFFFFFF is the maximum allowed value for integers that works for all
// Drupal supported databases and is known to work for other databases
// like SQL Server 2014 and Oracle 10 too.
$id = $string ? $this->randomMachineName() : mt_rand(1, 0x7FFFFFFF);
}
while (isset($this->generatedIds[$id]));
$this->generatedIds[$id] = $id;