From: Kyle Fazzari Date: Wed, 14 Nov 2018 16:41:38 +0000 (-0800) Subject: Verify that isPhpMailerUsed uses config as expected X-Git-Tag: v14.0.4RC2~3^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5ba33b757455ba8e63bffda0e95e4f819f9b0347;p=nextcloud-server.git Verify that isPhpMailerUsed uses config as expected Signed-off-by: Kyle Fazzari --- diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php index cc1ed6555c3..8da90b91bfd 100644 --- a/tests/Settings/Controller/CheckSetupControllerTest.php +++ b/tests/Settings/Controller/CheckSetupControllerTest.php @@ -511,6 +511,39 @@ 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, + ]) + ->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([