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
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-11-19 17:23:45 +0300
committerGitHub <noreply@github.com>2018-11-19 17:23:45 +0300
commit5af6289959475c46350249bfbaed7183be44353e (patch)
treef3bebc254423c1313503b3d9c6287f47364a6aeb /tests
parentea46c111a0b0352fc5e7ec67de25f64bcc30def0 (diff)
parent8e4f0f9d1734f15b28f10ce4b612b52b7621a3bc (diff)
Merge pull request #12401 from pachulo/fix/11107/fix-php-mail-warning
Fix the warning appearing in the admin section when mail_smtpmode is not configured
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/CheckSetupControllerTest.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php
index 34c7d19bd8d..ff565f3734b 100644
--- a/tests/Settings/Controller/CheckSetupControllerTest.php
+++ b/tests/Settings/Controller/CheckSetupControllerTest.php
@@ -520,6 +520,40 @@ class CheckSetupControllerTest extends TestCase {
$this->assertEquals($expected, $this->checkSetupController->check());
}
+ public function testIsPhpMailerUsed() {
+ $checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
+ ->setConstructorArgs([
+ 'settings',
+ $this->request,
+ $this->config,
+ $this->clientService,
+ $this->urlGenerator,
+ $this->util,
+ $this->l10n,
+ $this->checker,
+ $this->logger,
+ $this->dispatcher,
+ $this->db,
+ $this->lockingProvider,
+ $this->dateTimeFormatter,
+ $this->memoryInfo,
+ $this->secureRandom,
+ ])
+ ->setMethods(null)->getMock();
+
+ $this->config->expects($this->at(0))
+ ->method('getSystemValue')
+ ->with('mail_smtpmode', 'smtp')
+ ->will($this->returnValue('php'));
+ $this->config->expects($this->at(1))
+ ->method('getSystemValue')
+ ->with('mail_smtpmode', 'smtp')
+ ->will($this->returnValue('not-php'));
+
+ $this->assertTrue($this->invokePrivate($checkSetupController, 'isPhpMailerUsed'));
+ $this->assertFalse($this->invokePrivate($checkSetupController, 'isPhpMailerUsed'));
+ }
+
public function testGetCurlVersion() {
$checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
->setConstructorArgs([