Skip to content

Commit

Permalink
Fix a few tests that were using too big int values for 32bits
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jan 23, 2023
1 parent 6a4447a commit 045a249
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use OCP\IUserManager;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
use Psr\Log\LoggerInterface;

class ExpireTrashTest extends TestCase {
/** @var IConfig|MockObject */
Expand Down Expand Up @@ -61,7 +60,7 @@ protected function setUp(): void {

$this->time = $this->createMock(ITimeFactory::class);
$this->time->method('getTime')
->willReturn(99999999999);
->willReturn(999999999);

$this->jobList->expects($this->once())
->method('setLastRun');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
use Test\TestCase;

class ExpireVersionsTest extends TestCase {

/** @var IConfig|MockObject */
private $config;

Expand Down Expand Up @@ -70,7 +69,7 @@ public function testBackgroundJobDeactivated(): void {
$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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
use Test\TestCase;

class UsersControllerTest extends TestCase {

/** @var IUserManager|MockObject */
protected $userManager;
/** @var IConfig|MockObject */
Expand Down Expand Up @@ -497,7 +496,7 @@ public function testAddUserSuccessfulGenerateUserID() {
->method('generate')
->with(10)
->willReturnCallback(function () {
return (string)rand(1000000000, 9999999999);
return (string)rand(100000000, 999999999);
});

$this->assertTrue(key_exists(
Expand Down

0 comments on commit 045a249

Please sign in to comment.