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:
authorKyle Fazzari <kyrofa@ubuntu.com>2018-11-14 19:41:38 +0300
committerKyle Fazzari <kyrofa@ubuntu.com>2018-11-14 19:41:38 +0300
commit9561a7a1e2cacca3a1d2a775a2492d411fe02636 (patch)
treeb6a098cc491f50d7fe5eb483a0391f73c324f7fa /tests
parentea10c6a141ae7dcd813bc17f81a3f934e9ba32b6 (diff)
Verify that isPhpMailerUsed uses config as expected
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
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..617685d6196 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', null)
+ ->will($this->returnValue('php'));
+ $this->config->expects($this->at(1))
+ ->method('getSystemValue')
+ ->with('mail_smtpmode', null)
+ ->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([