Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-04-14 21:37:33 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-04-14 21:37:33 +0300
commitefd6f9017a5a48ea29c2b3b199a614a3b4c95ec3 (patch)
tree0523640153004edfe386bee7290eec4bb0d020d8 /lib
parentfd48f7b389a712570c7cae5aa8cfe79c93d22fac (diff)
use public method that can be mocked
Diffstat (limited to 'lib')
-rw-r--r--lib/service/autoconfig/ispdb.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/service/autoconfig/ispdb.php b/lib/service/autoconfig/ispdb.php
index 55f15bfc0..3e96c50ae 100644
--- a/lib/service/autoconfig/ispdb.php
+++ b/lib/service/autoconfig/ispdb.php
@@ -1,4 +1,5 @@
<?php
+
/**
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
@@ -17,8 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
+
namespace OCA\Mail\Service\AutoConfig;
+use Exception;
use OCA\Mail\Service\Logger;
class IspDb {
@@ -26,13 +29,21 @@ class IspDb {
/** @var Logger */
private $logger;
+ /** @var string[] */
+ public function getUrls() {
+ return [
+ 'https://autoconfig.{DOMAIN}/mail/config-v1.1.xml',
+ 'https://{DOMAIN}/.well-known/autoconfig/mail/config-v1.1.xml',
+ 'https://autoconfig.thunderbird.net/v1.1/{DOMAIN}',
+ ];
+ }
+
/**
* @param Logger $logger
* @param string[] $ispUrls
*/
- public function __construct(Logger $logger, $ispUrls) {
+ public function __construct(Logger $logger) {
$this->logger = $logger;
- $this->urls = $ispUrls;
}
private function queryUrl($url) {
@@ -85,7 +96,7 @@ class IspDb {
}
$provider = [];
- foreach ($this->urls as $url) {
+ foreach ($this->getUrls() as $url) {
$url = str_replace("{DOMAIN}", $domain, $url);
$this->logger->debug("IsbDb: querying <$domain> via <$url>");