Skip to content

Commit 1d2247f

Browse files
authored
Improves once related tests so they never fail (#50053)
1 parent c33547b commit 1d2247f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Support/OnceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,18 @@ public function testTemporaryDisable()
251251

252252
public function testMemoizationWithinEvals()
253253
{
254-
$firstResolver = eval('return fn () => once( function () { return random_int(1, 1000); } ) ;');
254+
$firstResolver = eval('return fn () => once( function () { return random_int(1, PHP_INT_MAX); } ) ;');
255255

256256
$firstA = $firstResolver();
257257
$firstB = $firstResolver();
258258

259-
$secondResolver = eval('return fn () => fn () => once( function () { return random_int(1, 1000); } ) ;');
259+
$secondResolver = eval('return fn () => fn () => once( function () { return random_int(1, PHP_INT_MAX); } ) ;');
260260

261261
$secondA = $secondResolver()();
262262
$secondB = $secondResolver()();
263263

264-
$third = eval('return once( function () { return random_int(1, 1000); } ) ;');
265-
$fourth = eval('return once( function () { return random_int(1, 1000); } ) ;');
264+
$third = eval('return once( function () { return random_int(1, PHP_INT_MAX); } ) ;');
265+
$fourth = eval('return once( function () { return random_int(1, PHP_INT_MAX); } ) ;');
266266

267267
$this->assertNotSame($firstA, $firstB);
268268
$this->assertNotSame($secondA, $secondB);

0 commit comments

Comments
 (0)