summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-03-30 21:26:06 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2016-03-30 21:26:14 +0200
commit0ee10a78ff89fdc4f85c0201ed997ab4f25633f0 (patch)
tree0785ae52ecb55d7650621a02904641e585b4c9d2
parent996c04bd0a2e18fa10a8686f92993d6bea6783fd (diff)
remove proxy code from config since its defined in config/config.php
-rw-r--r--config/config.php55
-rw-r--r--tests/unit/config/ConfigTest.php23
2 files changed, 1 insertions, 77 deletions
diff --git a/config/config.php b/config/config.php
index be2c057fc..a91c5053f 100644
--- a/config/config.php
+++ b/config/config.php
@@ -32,11 +32,6 @@ class Config {
private $loggerParams;
private $maxSize;
private $exploreUrl;
- private $proxyHost;
- private $proxyPort;
- private $proxyUser;
- private $proxyPassword;
-
public function __construct(Folder $fileSystem,
ILogger $logger,
@@ -49,38 +44,10 @@ class Config {
$this->feedFetcherTimeout = 60;
$this->useCronUpdates = true;
$this->logger = $logger;
- $this->proxyHost = '';
- $this->proxyPort = 8080;
- $this->proxyUser = '';
- $this->proxyPassword = '';
$this->exploreUrl = '';
$this->loggerParams = $LoggerParameters;
}
- public function getProxyPort() {
- return $this->proxyPort;
- }
-
- public function getProxyHost() {
- return $this->proxyHost;
- }
-
- public function getProxyAuth() {
- if($this->proxyUser === '') {
- return null;
- } else {
- return $this->proxyUser . ':' . $this->proxyPassword;
- }
- }
-
- public function getProxyUser() {
- return $this->proxyUser;
- }
-
- public function getProxyPassword() {
- return $this->proxyPassword;
- }
-
public function getAutoPurgeMinimumInterval() {
if ($this->autoPurgeMinimumInterval > 60) {
return $this->autoPurgeMinimumInterval;
@@ -89,7 +56,6 @@ class Config {
}
}
-
public function getAutoPurgeCount() {
return $this->autoPurgeCount;
}
@@ -144,27 +110,6 @@ class Config {
$this->useCronUpdates = $value;
}
-
- public function setProxyPort($value) {
- $this->proxyPort = $value;
- }
-
-
- public function setProxyHost($value) {
- $this->proxyHost = $value;
- }
-
-
- public function setProxyUser($value) {
- $this->proxyUser = $value;
- }
-
-
- public function setProxyPassword($value) {
- $this->proxyPassword = $value;
- }
-
-
public function setMaxSize($value) {
$this->maxSize = $value;
}
diff --git a/tests/unit/config/ConfigTest.php b/tests/unit/config/ConfigTest.php
index d2444fcf4..a30601403 100644
--- a/tests/unit/config/ConfigTest.php
+++ b/tests/unit/config/ConfigTest.php
@@ -43,11 +43,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(10, $this->config->getMaxRedirects());
$this->assertEquals(60, $this->config->getFeedFetcherTimeout());
$this->assertEquals(true, $this->config->getUseCronUpdates());
- $this->assertEquals(8080, $this->config->getProxyPort());
- $this->assertEquals('', $this->config->getProxyHost());
- $this->assertEquals(null, $this->config->getProxyAuth());
- $this->assertEquals('', $this->config->getProxyUser());
- $this->assertEquals('', $this->config->getProxyPassword());
$this->assertEquals('', $this->config->getExploreUrl());
$this->assertEquals(1024*1024*100, $this->config->getMaxSize());
}
@@ -155,10 +150,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase {
'feedFetcherTimeout = 60' . "\n" .
'useCronUpdates = true';
$this->config->setAutoPurgeCount(3);
- $this->config->setProxyHost('yo man');
- $this->config->setProxyPort(12);
- $this->config->setProxyUser('this is a test');
- $this->config->setProxyPassword('se');
$this->config->setMaxSize(399);
$this->config->setExploreUrl('http://google.de');
@@ -175,10 +166,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase {
}
- public function testNoProxyAuthReturnsNull() {
- $this->assertNull($this->config->getProxyAuth());
- }
-
public function testReadingNonExistentConfigWillWriteDefaults() {
$this->fileSystem->expects($this->once())
@@ -212,14 +199,6 @@ class ConfigTest extends PHPUnit_Framework_TestCase {
}
- public function testEncodesUserAndPasswordInHTTPBasicAuth() {
- $this->config->setProxyUser('this is a test');
- $this->config->setProxyPassword('se');
-
- $this->assertEquals('this is a test:se', $this->config->getProxyAuth());
- }
-
-
public function testNoLowMinimumAutoPurgeInterval() {
$this->config->setAutoPurgeMinimumInterval(59);
$interval = $this->config->getAutoPurgeMinimumInterval();
@@ -248,4 +227,4 @@ class ConfigTest extends PHPUnit_Framework_TestCase {
$this->assertSame(2, $timout);
}
-} \ No newline at end of file
+}