Skip to content

Commit 11f9ed3

Browse files
committed
fix: failing tests
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
1 parent 230f6f8 commit 11f9ed3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tests/Unit/Activity/ProviderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ public function testGetRichParams(string $subject, array $subjectParams, array $
375375
->willReturn($form);
376376

377377
$this->validator->expects($this->any())
378-
->method('validate')
379-
->willReturn(true);
378+
->method('validate');
380379

381380
$this->assertEquals($expected, $this->provider->getRichParams($l10n, $subject, $subjectParams));
382381
}

tests/Unit/FormsMigratorTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
use OCP\IL10N;
4242
use OCP\IUser;
4343
use OCP\IUserManager;
44+
use OCP\ServerVersion;
4445
use OCP\UserMigration\IExportDestination;
4546
use OCP\UserMigration\IImportSource;
4647
use PHPUnit\Framework\MockObject\MockObject;
@@ -80,11 +81,16 @@ class FormsMigratorTest extends TestCase {
8081
/** @var IUserManager|MockObject */
8182
private $userManager;
8283

84+
/** @var ServerVersion|MockObject */
85+
private $serverVersion;
86+
8387
public function setUp(): void {
8488
parent::setUp();
8589

90+
$serverVersion = \OCP\Server::get(ServerVersion::class);
91+
8692
// UserMigration is not available below NC24, skip all tests here.
87-
if (\OC_Util::getVersion()[0] < 24) {
93+
if ($serverVersion->getMajorVersion() < 24) {
8894
$this->markTestSkipped('UserMigration not available below NC24');
8995
}
9096

0 commit comments

Comments
 (0)