Verify that isPhpMailerUsed uses config as expected

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
This commit is contained in:
Kyle Fazzari 2018-11-14 08:41:38 -08:00
parent ea10c6a141
commit 9561a7a1e2
No known key found for this signature in database
GPG Key ID: A7D23FB0E778DEDF
1 changed files with 34 additions and 0 deletions

View File

@ -520,6 +520,40 @@ class CheckSetupControllerTest extends TestCase {
$this->assertEquals($expected, $this->checkSetupController->check()); $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() { public function testGetCurlVersion() {
$checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController') $checkSetupController = $this->getMockBuilder('\OC\Settings\Controller\CheckSetupController')
->setConstructorArgs([ ->setConstructorArgs([