summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-04 17:52:33 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-04 17:52:33 +0200
commit17e6d0483bbd0690f6da32c6ae59e0dce51f172c (patch)
treeea18d238ba1ced780fb3710af4b506d312e47cfc /tests
parent8c27dc74baeb8c6405b399e140290234bb2a3856 (diff)
first round of xpatharticleenhancer cleanup
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/articleenhancer/XPathArticleEnhancerTest.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
index 7756c168a..2f6f5688e 100644
--- a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
+++ b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
@@ -95,65 +95,6 @@ class XPathArticleEnhancerTest extends \PHPUnit_Framework_TestCase {
}
- public function testXPathUsesProxy() {
- $this->config = $this->getMockBuilder(
- '\OCA\News\Utility\Config')
- ->disableOriginalConstructor()
- ->getMock();
- $this->config->expects($this->any())
- ->method('getProxyHost')
- ->will($this->returnValue($this->proxyHost));
- $this->config->expects($this->any())
- ->method('getProxyAuth')
- ->will($this->returnValue($this->proxyAuth));
- $this->config->expects($this->any())
- ->method('getProxyPort')
- ->will($this->returnValue($this->proxyPort));
- $this->config->expects($this->any())
- ->method('getFeedFetcherTimeout')
- ->will($this->returnValue($this->timeout));
-
- $this->testEnhancer = new XPathArticleEnhancer(
- $this->fileFactory,
- [
- '/explosm.net\/comics/' => '//*[@id=\'maincontent\']/div[2]/div/span',
- '/explosm.net\/shorts/' => '//*[@id=\'maincontent\']/div/div',
- '/explosm.net\/all/' => '//body/*',
- '/themerepublic.net/' => '//*[@class=\'post hentry\']'
- ],
- $this->config
- );
-
- $file = new \stdClass;
- $file->headers = ["content-type"=>"text/html; charset=utf-8"];
- $file->body = '';
- $item = new Item();
- $item->setUrl('https://www.explosm.net/comics/312');
- $item->setBody('Hello thar');
-
- $this->config->expects($this->any())
- ->method('getProxyHost')
- ->will($this->returnValue($this->proxyHost));
-
- $this->fileFactory->expects($this->once())
- ->method('getFile')
- ->with($this->equalTo($item->getUrl()),
- $this->equalTo($this->timeout),
- $this->equalTo($this->redirects),
- $this->equalTo($this->headers),
- $this->equalTo($this->userAgent),
- $this->equalTo(false),
- $this->equalTo($this->proxyHost),
- $this->equalTo($this->proxyPort),
- $this->equalTo($this->proxyAuth))
- ->will($this->returnValue($file));
-
- $result = $this->testEnhancer->enhance($item);
- $this->assertEquals('Hello thar', $result->getBody());
- }
-
-
-
public function testDoesNotModifiyNotMatchingResults() {
$item = new Item();
$item->setUrl('http://explosm.net');