Skip to content

Commit 5f9f997

Browse files
authored
Merge pull request #26275 from nextcloud/backport/26265/stable20
[stable20] Fix casing of core test folder, bring back missing tests
2 parents 07887d6 + d86c4f9 commit 5f9f997

File tree

7 files changed

+17
-8
lines changed

7 files changed

+17
-8
lines changed

tests/Core/Command/Preview/RepairTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use OCP\Files\Node;
1010
use OCP\IConfig;
1111
use OCP\ILogger;
12+
use OCP\Lock\ILockingProvider;
1213
use PHPUnit\Framework\MockObject\MockObject;
1314
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1415
use Symfony\Component\Console\Input\InputInterface;
@@ -43,7 +44,13 @@ protected function setUp(): void {
4344
->getMock();
4445
$this->iniGetWrapper = $this->getMockBuilder(IniGetWrapper::class)
4546
->getMock();
46-
$this->repair = new Repair($this->config, $this->rootFolder, $this->logger, $this->iniGetWrapper);
47+
$this->repair = new Repair(
48+
$this->config,
49+
$this->rootFolder,
50+
$this->logger,
51+
$this->iniGetWrapper,
52+
$this->createMock(ILockingProvider::class)
53+
);
4754
$this->input = $this->getMockBuilder(InputInterface::class)
4855
->getMock();
4956
$this->input->expects($this->any())

tests/Core/Controller/LoginControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ public function testLoginWithInvalidCredentials() {
440440
->with('core.login.showLoginForm', [
441441
'user' => $user,
442442
'redirect_url' => '/apps/files',
443+
'direct' => 1,
443444
])
444445
->willReturn($loginPageUrl);
445446
$expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl);
@@ -597,6 +598,7 @@ public function testToNotLeakLoginName() {
597598
->with('core.login.showLoginForm', [
598599
'user' => '[email protected]',
599600
'redirect_url' => '/apps/files',
601+
'direct' => 1,
600602
])
601603
->willReturn($loginPageUrl);
602604
$expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl);

tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase {
5252
/** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
5353
private $userManager;
5454

55-
public function setUp() {
55+
public function setUp(): void {
5656
parent::setUp();
5757

5858
$this->rootFolder = $this->createMock(IRootFolder::class);

tests/Test/Repair/Owncloud/CleanPreviewsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CleanPreviewsTest extends TestCase {
4646
/** @var CleanPreviews */
4747
private $repair;
4848

49-
public function setUp() {
49+
public function setUp(): void {
5050
parent::setUp();
5151

5252
$this->jobList = $this->createMock(IJobList::class);

tests/Test/Repair/Owncloud/InstallCoreBundleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class InstallCoreBundleTest extends TestCase {
4141
/** @var InstallCoreBundle */
4242
private $installCoreBundle;
4343

44-
public function setUp() {
44+
public function setUp(): void {
4545
parent::setUp();
4646
$this->bundleFetcher = $this->createMock(BundleFetcher::class);
4747
$this->config = $this->createMock(IConfig::class);

tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class UpdateLanguageCodesTest extends TestCase {
4343
/** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
4444
private $config;
4545

46-
protected function setUp() {
46+
protected function setUp(): void {
4747
parent::setUp();
4848

4949
$this->connection = \OC::$server->getDatabaseConnection();
@@ -86,6 +86,7 @@ public function testRun() {
8686
->from('preferences')
8787
->where($qb->expr()->eq('appid', $qb->createNamedParameter('core')))
8888
->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lang')))
89+
->orderBy('userid')
8990
->execute();
9091

9192
$rows = $result->fetchAll();

tests/phpunit-autotest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
>
99
<testsuite name='ownCloud'>
1010
<directory suffix='.php'>lib/</directory>
11-
<directory suffix='.php'>core/</directory>
12-
<directory suffix='.php'>ocs-provider/</directory>
11+
<directory suffix='.php'>Core/</directory>
12+
<directory suffix='.php'>Test/</directory>
1313
<file>apps.php</file>
1414
</testsuite>
1515
<!-- filters for code coverage -->
@@ -32,4 +32,3 @@
3232
<listener class="StartSessionListener" file="startsessionlistener.php" />
3333
</listeners>
3434
</phpunit>
35-

0 commit comments

Comments
 (0)