summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSylvia van Os <sylvia@hackerchick.me>2018-11-22 10:14:27 +0100
committerSylvia van Os <sylvia@hackerchick.me>2018-11-22 10:57:16 +0100
commit935bb256398a6ebab4e882fc740487dfbd401f73 (patch)
treefdbce36b7d183b1e76fa2067c75af36e3d3eda91 /tests
parentb7767a51f140d3f588278f053f3a9e1eb84e4346 (diff)
downloadnextcloud-server-935bb256398a6ebab4e882fc740487dfbd401f73.tar.gz
nextcloud-server-935bb256398a6ebab4e882fc740487dfbd401f73.zip
Make connectivity check domains configurable
Signed-off-by: Sylvia van Os <sylvia@hackerchick.me>
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/CheckSetupControllerTest.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php
index ff565f3734b..7731e08eed0 100644
--- a/tests/Settings/Controller/CheckSetupControllerTest.php
+++ b/tests/Settings/Controller/CheckSetupControllerTest.php
@@ -189,10 +189,15 @@ class CheckSetupControllerTest extends TestCase {
}
public function testIsInternetConnectionWorkingCorrectly() {
- $this->config->expects($this->once())
+ $this->config->expects($this->at(0))
->method('getSystemValue')
->with('has_internet_connection', true)
- ->will($this->returnValue(true));
+ ->will($this->returnValue(true));
+
+ $this->config->expects($this->at(1))
+ ->method('getSystemValue')
+ ->with('connectivity_check_domains', ['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org'])
+ ->will($this->returnValue(['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org']));
$client = $this->getMockBuilder('\OCP\Http\Client\IClient')
->disableOriginalConstructor()->getMock();
@@ -213,10 +218,15 @@ class CheckSetupControllerTest extends TestCase {
}
public function testIsInternetConnectionFail() {
- $this->config->expects($this->once())
+ $this->config->expects($this->at(0))
->method('getSystemValue')
->with('has_internet_connection', true)
- ->will($this->returnValue(true));
+ ->will($this->returnValue(true));
+
+ $this->config->expects($this->at(1))
+ ->method('getSystemValue')
+ ->with('connectivity_check_domains', ['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org'])
+ ->will($this->returnValue(['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org']));
$client = $this->getMockBuilder('\OCP\Http\Client\IClient')
->disableOriginalConstructor()->getMock();
@@ -339,13 +349,17 @@ class CheckSetupControllerTest extends TestCase {
->willReturn('');
$this->config->expects($this->at(2))
->method('getSystemValue')
+ ->with('connectivity_check_domains', ['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org'])
+ ->will($this->returnValue(['www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org']));
+ $this->config->expects($this->at(3))
+ ->method('getSystemValue')
->with('memcache.local', null)
->will($this->returnValue('SomeProvider'));
- $this->config->expects($this->at(3))
+ $this->config->expects($this->at(4))
->method('getSystemValue')
->with('has_internet_connection', true)
->will($this->returnValue(true));
- $this->config->expects($this->at(4))
+ $this->config->expects($this->at(5))
->method('getSystemValue')
->with('appstoreenabled', true)
->will($this->returnValue(false));