mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 02:31:33 -04:00
Merge pull request #12529 from nextcloud/backport/12401/php-warning
[stable14] Fix the warning appearing in the admin section when mail_smtpmode is not configured
This commit is contained in:
commit
b133ca311e
2 changed files with 34 additions and 1 deletions
|
|
@ -529,7 +529,7 @@ Raw output
|
|||
}
|
||||
|
||||
protected function isPhpMailerUsed(): bool {
|
||||
return $this->config->getSystemValue('mail_smtpmode', 'php') === 'php';
|
||||
return $this->config->getSystemValue('mail_smtpmode', 'smtp') === 'php';
|
||||
}
|
||||
|
||||
protected function hasOpcacheLoaded(): bool {
|
||||
|
|
|
|||
|
|
@ -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', '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([
|
||||
|
|
|
|||
Loading…
Reference in a new issue