diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-03-24 23:45:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 23:45:42 +0300 |
commit | 5f9f997a33565b37fb2bcfbc7e2018e3b7b667a7 (patch) | |
tree | c2cc112c4269bcea46dc164cf3b194bbbc38c7bf /tests | |
parent | 07887d62c6b030a55d97be75c06220899870e372 (diff) | |
parent | d86c4f9662478862e4660ad8ce73bde40d1fdef9 (diff) |
Merge pull request #26275 from nextcloud/backport/26265/stable20
[stable20] Fix casing of core test folder, bring back missing tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Command/Preview/RepairTest.php | 9 | ||||
-rw-r--r-- | tests/Core/Controller/LoginControllerTest.php | 2 | ||||
-rw-r--r-- | tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php | 2 | ||||
-rw-r--r-- | tests/Test/Repair/Owncloud/CleanPreviewsTest.php | 2 | ||||
-rw-r--r-- | tests/Test/Repair/Owncloud/InstallCoreBundleTest.php | 2 | ||||
-rw-r--r-- | tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php | 3 | ||||
-rw-r--r-- | tests/phpunit-autotest.xml | 5 |
7 files changed, 17 insertions, 8 deletions
diff --git a/tests/Core/Command/Preview/RepairTest.php b/tests/Core/Command/Preview/RepairTest.php index 68f32c1f498..c37e57f848c 100644 --- a/tests/Core/Command/Preview/RepairTest.php +++ b/tests/Core/Command/Preview/RepairTest.php @@ -9,6 +9,7 @@ use OCP\Files\IRootFolder; use OCP\Files\Node; use OCP\IConfig; use OCP\ILogger; +use OCP\Lock\ILockingProvider; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Input\InputInterface; @@ -43,7 +44,13 @@ class RepairTest extends TestCase { ->getMock(); $this->iniGetWrapper = $this->getMockBuilder(IniGetWrapper::class) ->getMock(); - $this->repair = new Repair($this->config, $this->rootFolder, $this->logger, $this->iniGetWrapper); + $this->repair = new Repair( + $this->config, + $this->rootFolder, + $this->logger, + $this->iniGetWrapper, + $this->createMock(ILockingProvider::class) + ); $this->input = $this->getMockBuilder(InputInterface::class) ->getMock(); $this->input->expects($this->any()) diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php index e9d4a89aa7d..e3469621eec 100644 --- a/tests/Core/Controller/LoginControllerTest.php +++ b/tests/Core/Controller/LoginControllerTest.php @@ -440,6 +440,7 @@ class LoginControllerTest extends TestCase { ->with('core.login.showLoginForm', [ 'user' => $user, 'redirect_url' => '/apps/files', + 'direct' => 1, ]) ->willReturn($loginPageUrl); $expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl); @@ -597,6 +598,7 @@ class LoginControllerTest extends TestCase { ->with('core.login.showLoginForm', [ 'user' => 'john@doe.com', 'redirect_url' => '/apps/files', + 'direct' => 1, ]) ->willReturn($loginPageUrl); $expected = new \OCP\AppFramework\Http\RedirectResponse($loginPageUrl); diff --git a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php index 267f01ca43f..a487e021187 100644 --- a/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php +++ b/tests/Test/Repair/Owncloud/CleanPreviewsBackgroundJobTest.php @@ -52,7 +52,7 @@ class CleanPreviewsBackgroundJobTest extends TestCase { /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */ private $userManager; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->rootFolder = $this->createMock(IRootFolder::class); diff --git a/tests/Test/Repair/Owncloud/CleanPreviewsTest.php b/tests/Test/Repair/Owncloud/CleanPreviewsTest.php index 131b80517fb..abd166057be 100644 --- a/tests/Test/Repair/Owncloud/CleanPreviewsTest.php +++ b/tests/Test/Repair/Owncloud/CleanPreviewsTest.php @@ -46,7 +46,7 @@ class CleanPreviewsTest extends TestCase { /** @var CleanPreviews */ private $repair; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->jobList = $this->createMock(IJobList::class); diff --git a/tests/Test/Repair/Owncloud/InstallCoreBundleTest.php b/tests/Test/Repair/Owncloud/InstallCoreBundleTest.php index 37163aee961..61be5006c41 100644 --- a/tests/Test/Repair/Owncloud/InstallCoreBundleTest.php +++ b/tests/Test/Repair/Owncloud/InstallCoreBundleTest.php @@ -41,7 +41,7 @@ class InstallCoreBundleTest extends TestCase { /** @var InstallCoreBundle */ private $installCoreBundle; - public function setUp() { + public function setUp(): void { parent::setUp(); $this->bundleFetcher = $this->createMock(BundleFetcher::class); $this->config = $this->createMock(IConfig::class); diff --git a/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php b/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php index 171b7701194..3b0b2f57f5f 100644 --- a/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php +++ b/tests/Test/Repair/Owncloud/UpdateLanguageCodesTest.php @@ -43,7 +43,7 @@ class UpdateLanguageCodesTest extends TestCase { /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */ private $config; - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); @@ -86,6 +86,7 @@ class UpdateLanguageCodesTest extends TestCase { ->from('preferences') ->where($qb->expr()->eq('appid', $qb->createNamedParameter('core'))) ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lang'))) + ->orderBy('userid') ->execute(); $rows = $result->fetchAll(); diff --git a/tests/phpunit-autotest.xml b/tests/phpunit-autotest.xml index 17b0b62c0b7..c293d1c7d59 100644 --- a/tests/phpunit-autotest.xml +++ b/tests/phpunit-autotest.xml @@ -8,8 +8,8 @@ > <testsuite name='ownCloud'> <directory suffix='.php'>lib/</directory> - <directory suffix='.php'>core/</directory> - <directory suffix='.php'>ocs-provider/</directory> + <directory suffix='.php'>Core/</directory> + <directory suffix='.php'>Test/</directory> <file>apps.php</file> </testsuite> <!-- filters for code coverage --> @@ -32,4 +32,3 @@ <listener class="StartSessionListener" file="startsessionlistener.php" /> </listeners> </phpunit> - |