Browse Source

Fix a few tests that were using too big int values for 32bits

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Côme Chilliet 1 year ago
parent
commit
0753be3ff2

+ 1 - 2
apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php

@@ -33,7 +33,6 @@ use OCP\IConfig;
 use OCP\IUserManager;
 use PHPUnit\Framework\MockObject\MockObject;
 use Test\TestCase;
-use Psr\Log\LoggerInterface;
 
 class ExpireTrashTest extends TestCase {
 	/** @var IConfig|MockObject */
@@ -61,7 +60,7 @@ class ExpireTrashTest extends TestCase {
 
 		$this->time = $this->createMock(ITimeFactory::class);
 		$this->time->method('getTime')
-			->willReturn(99999999999);
+			->willReturn(999999999);
 
 		$this->jobList->expects($this->once())
 			->method('setLastRun');

+ 1 - 2
apps/files_versions/tests/BackgroundJob/ExpireVersionsTest.php

@@ -33,7 +33,6 @@ use PHPUnit\Framework\MockObject\MockObject;
 use Test\TestCase;
 
 class ExpireVersionsTest extends TestCase {
-
 	/** @var IConfig|MockObject */
 	private $config;
 
@@ -70,7 +69,7 @@ class ExpireVersionsTest extends TestCase {
 		$timeFactory = $this->createMock(ITimeFactory::class);
 		$timeFactory->method('getTime')
 			->with()
-			->willReturn(99999999999);
+			->willReturn(999999999);
 
 		$job = new ExpireVersions($this->config, $this->userManager, $this->expiration, $timeFactory);
 		$job->start($this->jobList);

+ 1 - 2
apps/provisioning_api/tests/Controller/UsersControllerTest.php

@@ -73,7 +73,6 @@ use Psr\Log\LoggerInterface;
 use Test\TestCase;
 
 class UsersControllerTest extends TestCase {
-
 	/** @var IUserManager|MockObject */
 	protected $userManager;
 	/** @var IConfig|MockObject */
@@ -497,7 +496,7 @@ class UsersControllerTest extends TestCase {
 			->method('generate')
 			->with(10)
 			->willReturnCallback(function () {
-				return (string)rand(1000000000, 9999999999);
+				return (string)rand(100000000, 999999999);
 			});
 
 		$this->assertTrue(key_exists(