Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2022-02-03 14:28:37 +0300
committerSimon L. (Rebase PR Action) <szaimen@e.mail.de>2022-02-16 01:56:47 +0300
commit11941e824ac71236ca30509b701c0f828db45025 (patch)
tree6237dcbb97cb0270313326f5a37d274ece80b346
parentc49a55eb08e92438cec0ad0649f5cfea9436d764 (diff)
fix tests
Signed-off-by: szaimen <szaimen@e.mail.de>
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php6
-rw-r--r--apps/settings/tests/Controller/MailSettingsControllerTest.php7
-rw-r--r--core/js/tests/specs/setupchecksSpec.js18
3 files changed, 30 insertions, 1 deletions
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index 478c4519b2f..20cf2b01069 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -182,6 +182,7 @@ class CheckSetupControllerTest extends TestCase {
])
->setMethods([
'isReadOnlyConfig',
+ 'wasEmailTestSuccessful',
'hasValidTransactionIsolationLevel',
'hasFileinfoInstalled',
'hasWorkingFileLocking',
@@ -508,6 +509,10 @@ class CheckSetupControllerTest extends TestCase {
->willReturn(false);
$this->checkSetupController
->expects($this->once())
+ ->method('wasEmailTestSuccessful')
+ ->willReturn(false);
+ $this->checkSetupController
+ ->expects($this->once())
->method('hasValidTransactionIsolationLevel')
->willReturn(true);
$this->checkSetupController
@@ -604,6 +609,7 @@ class CheckSetupControllerTest extends TestCase {
[
'isGetenvServerWorking' => true,
'isReadOnlyConfig' => false,
+ 'wasEmailTestSuccessful' => false,
'hasValidTransactionIsolationLevel' => true,
'hasFileinfoInstalled' => true,
'hasWorkingFileLocking' => true,
diff --git a/apps/settings/tests/Controller/MailSettingsControllerTest.php b/apps/settings/tests/Controller/MailSettingsControllerTest.php
index 93fffadcfe1..54461201201 100644
--- a/apps/settings/tests/Controller/MailSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/MailSettingsControllerTest.php
@@ -38,6 +38,7 @@ use OCP\IRequest;
use OCP\IUserSession;
use OCP\Mail\IEMailTemplate;
use OCP\Mail\IMailer;
+use OCP\IURLGenerator;
/**
* @package Tests\Settings\Controller
@@ -52,6 +53,8 @@ class MailSettingsControllerTest extends \Test\TestCase {
private $mailer;
/** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
private $l;
+ /** @var IURLGenerator */
+ private $urlGenerator;
/** @var MailSettingsController */
private $mailController;
@@ -63,6 +66,7 @@ class MailSettingsControllerTest extends \Test\TestCase {
$this->config = $this->createMock(IConfig::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->mailer = $this->createMock(IMailer::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject $request */
$request = $this->createMock(IRequest::class);
$this->mailController = new MailSettingsController(
@@ -71,6 +75,7 @@ class MailSettingsControllerTest extends \Test\TestCase {
$this->l,
$this->config,
$this->userSession,
+ $this->urlGenerator,
$this->mailer,
'no-reply@nextcloud.com'
);
@@ -170,7 +175,7 @@ class MailSettingsControllerTest extends \Test\TestCase {
// Ensure that it fails when no mail address has been specified
$response = $this->mailController->sendTestMail();
$this->assertSame(Http::STATUS_BAD_REQUEST, $response->getStatus());
- $this->assertSame('You need to set your user email before being able to send test emails.', $response->getData());
+ $this->assertSame('You need to set your user email before being able to send test emails. Go to for that.', $response->getData());
// If no exception is thrown it should work
$this->config
diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js
index c3e7fab14f1..a226cb92501 100644
--- a/core/js/tests/specs/setupchecksSpec.js
+++ b/core/js/tests/specs/setupchecksSpec.js
@@ -226,6 +226,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -283,6 +284,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -341,6 +343,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -396,6 +399,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -450,6 +454,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -504,6 +509,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -560,6 +566,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -614,6 +621,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -668,6 +676,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -742,6 +751,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -797,6 +807,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -852,6 +863,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -907,6 +919,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -965,6 +978,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -1020,6 +1034,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -1072,6 +1087,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -1126,6 +1142,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',
@@ -1180,6 +1197,7 @@ describe('OC.SetupChecks tests', function() {
hasFileinfoInstalled: true,
isGetenvServerWorking: true,
isReadOnlyConfig: false,
+ wasEmailTestSuccessful: true,
hasWorkingFileLocking: true,
hasValidTransactionIsolationLevel: true,
suggestedOverwriteCliURL: '',