From 0ee10a78ff89fdc4f85c0201ed997ab4f25633f0 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 30 Mar 2016 21:26:06 +0200 Subject: remove proxy code from config since its defined in config/config.php --- config/config.php | 55 ---------------------------------------- tests/unit/config/ConfigTest.php | 23 +---------------- 2 files changed, 1 insertion(+), 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 +} -- cgit v1.2.3