diff --git a/tests/Fixtures/Blog/PrimaryKey.php b/tests/Fixtures/Blog/PrimaryKey.php index 210d934..d333495 100644 --- a/tests/Fixtures/Blog/PrimaryKey.php +++ b/tests/Fixtures/Blog/PrimaryKey.php @@ -3,13 +3,13 @@ namespace ShipMonkTests\DoctrineEntityPreloader\Fixtures\Blog; use function base64_encode; -use function random_int; class PrimaryKey { public const DOCTRINE_TYPE_NAME = 'primary_key'; - public const LENGTH_BYTES = 4; + + private static int $autoIncrement = 0; private int $data; @@ -20,10 +20,7 @@ public function __construct(int $data) public static function new(): self { - $bits = self::LENGTH_BYTES * 8; - $maxValue = (1 << $bits) - 1; - - return new self(random_int(0, $maxValue)); + return new self(self::$autoIncrement++); } public function getData(): int diff --git a/tests/Fixtures/Blog/Type/PrimaryKeyBinaryType.php b/tests/Fixtures/Blog/Type/PrimaryKeyBinaryType.php index b43e9a3..cd8f601 100644 --- a/tests/Fixtures/Blog/Type/PrimaryKeyBinaryType.php +++ b/tests/Fixtures/Blog/Type/PrimaryKeyBinaryType.php @@ -56,7 +56,7 @@ public function getSQLDeclaration( ): string { return $platform->getBinaryTypeDeclarationSQL([ - 'length' => PrimaryKey::LENGTH_BYTES, + 'length' => 4, 'fixed' => true, ]); }