summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-12 23:26:59 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-12 23:26:59 +0200
commit937f025137cf511eba332260ea1ae876090b7d43 (patch)
tree1e35307731960700cddea26e0e4b0621ebb251c0 /tests
parent2dd8827768379ef8a96611b7b702464da8fd7349 (diff)
remove more unused code
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/businesslayer/FeedBusinessLayerTest.php5
-rw-r--r--tests/unit/controller/FeedControllerTest.php8
-rw-r--r--tests/unit/db/MapperTest.php24
-rw-r--r--tests/unit/utility/FaviconFetcherTest.php12
4 files changed, 12 insertions, 37 deletions
diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php
index bd8e6fabd..2c6aa9ac9 100644
--- a/tests/unit/businesslayer/FeedBusinessLayerTest.php
+++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php
@@ -247,7 +247,6 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
public function testUpdateCreatesNewEntry(){
$feed = new Feed();
$feed->setId(3);
- $feed->getUrl('test');
$feed->setArticlesPerUpdate(1);
$feed->setUrlHash('yo');
@@ -303,7 +302,6 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
public function testUpdateUpdatesArticlesPerFeedCount() {
$feed = new Feed();
$feed->setId(3);
- $feed->getUrl('test');
$feed->setUrlHash('yo');
$existingFeed = new Feed();
@@ -335,7 +333,6 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
public function testUpdateFails(){
$feed = new Feed();
$feed->setId(3);
- $feed->getUrl('test');
$ex = new FetcherException('');
$this->feedMapper->expects($this->at(0))
@@ -363,7 +360,6 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
public function testUpdateDoesNotFindEntry() {
$feed = new Feed();
$feed->setId(3);
- $feed->getUrl('test');
$ex = new DoesNotExistException('');
@@ -381,7 +377,6 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase {
public function testUpdateDoesNotFindUpdatedEntry() {
$feed = new Feed();
$feed->setId(3);
- $feed->getUrl('test');
$feed->setArticlesPerUpdate(1);
$item = new Item();
diff --git a/tests/unit/controller/FeedControllerTest.php b/tests/unit/controller/FeedControllerTest.php
index a8309b41c..f4f22f108 100644
--- a/tests/unit/controller/FeedControllerTest.php
+++ b/tests/unit/controller/FeedControllerTest.php
@@ -458,12 +458,6 @@ class FeedControllerTest extends ControllerTestUtility {
public function testUpdateReturnsJSONError(){
- $result = array(
- 'feeds' => array(
- new Feed()
- )
- );
-
$url = array(
'feedId' => 4
);
@@ -601,8 +595,6 @@ class FeedControllerTest extends ControllerTestUtility {
public function testImportCreatesNoAdditionalFeed() {
- $feed = new Feed();
-
$post = array(
'json' => 'the json'
);
diff --git a/tests/unit/db/MapperTest.php b/tests/unit/db/MapperTest.php
index b25fc4fcc..52c8f205d 100644
--- a/tests/unit/db/MapperTest.php
+++ b/tests/unit/db/MapperTest.php
@@ -63,7 +63,7 @@ class MapperTest extends MapperTestUtility {
$rows = array(
array('hi')
);
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->mapper->find($sql, $params);
}
@@ -73,7 +73,7 @@ class MapperTest extends MapperTestUtility {
$rows = array(
array('pre_name' => 'hi')
);
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->mapper->findOneEntity($sql, $params);
}
@@ -81,7 +81,7 @@ class MapperTest extends MapperTestUtility {
$sql = 'hi';
$params = array('jo');
$rows = array();
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->setExpectedException(
'\OCA\News\Db\DoesNotExistException');
$this->mapper->find($sql, $params);
@@ -91,7 +91,7 @@ class MapperTest extends MapperTestUtility {
$sql = 'hi';
$params = array('jo');
$rows = array();
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->setExpectedException(
'\OCA\News\Db\DoesNotExistException');
$this->mapper->findOneEntity($sql, $params);
@@ -103,7 +103,7 @@ class MapperTest extends MapperTestUtility {
$rows = array(
array('jo'), array('ho')
);
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->setExpectedException(
'\OCA\News\Db\MultipleObjectsReturnedException');
$this->mapper->find($sql, $params);
@@ -115,7 +115,7 @@ class MapperTest extends MapperTestUtility {
$rows = array(
array('jo'), array('ho')
);
- $row = $this->setMapperResult($sql, $params, $rows);
+ $this->setMapperResult($sql, $params, $rows);
$this->setExpectedException(
'\OCA\News\Db\MultipleObjectsReturnedException');
$this->mapper->findOneEntity($sql, $params);
@@ -196,12 +196,6 @@ class MapperTest extends MapperTestUtility {
public function testUpdateNoId(){
- $sql = 'UPDATE `*PREFIX*table` ' .
- 'SET ' .
- '`pre_name` = ?,'.
- '`email` = ? ' .
- 'WHERE `id` = ?';
-
$params = array('john', 'my@email');
$entity = new Example();
$entity->setPreName($params[0]);
@@ -230,7 +224,7 @@ class MapperTest extends MapperTestUtility {
$entity = new Example();
$entity->setPreName('hi');
$entity->resetUpdatedFields();
- $row = $this->setMapperResult($sql, array(), $rows);
+ $this->setMapperResult($sql, array(), $rows);
$result = $this->mapper->findAllEntities($sql);
$this->assertEquals(array($entity), $result);
}
@@ -238,7 +232,7 @@ class MapperTest extends MapperTestUtility {
public function testFindEntitiesNotFound(){
$sql = 'hi';
$rows = array();
- $row = $this->setMapperResult($sql, array(), $rows);
+ $this->setMapperResult($sql, array(), $rows);
$result = $this->mapper->findAllEntities($sql);
$this->assertEquals(array(), $result);
}
@@ -254,7 +248,7 @@ class MapperTest extends MapperTestUtility {
$entity2 = new Example();
$entity2->setEmail('ho');
$entity2->resetUpdatedFields();
- $row = $this->setMapperResult($sql, array(), $rows);
+ $this->setMapperResult($sql, array(), $rows);
$result = $this->mapper->findAllEntities($sql);
$this->assertEquals(array($entity1, $entity2), $result);
}
diff --git a/tests/unit/utility/FaviconFetcherTest.php b/tests/unit/utility/FaviconFetcherTest.php
index 3dbb441f0..833154639 100644
--- a/tests/unit/utility/FaviconFetcherTest.php
+++ b/tests/unit/utility/FaviconFetcherTest.php
@@ -242,13 +242,11 @@ class FaviconFetcherTest extends \PHPUnit_Framework_TestCase {
$html = $this->getFaviconHTML($faviconPath);
$url = '';
- $pageMock = $this->getFileMock($html);
- $pngMock = $this->getFileMock($this->png);
$this->fileFactory->expects($this->never())
->method('getFile');
- $favicon = $this->fetcher->fetch($url);
+ $this->fetcher->fetch($url);
}
public function testInvalidHostnameDoesNotOpenFile() {
@@ -256,13 +254,11 @@ class FaviconFetcherTest extends \PHPUnit_Framework_TestCase {
$html = $this->getFaviconHTML($faviconPath);
$url = "a.b_c.de";
- $pageMock = $this->getFileMock($html);
- $pngMock = $this->getFileMock($this->png);
$this->fileFactory->expects($this->never())
->method('getFile');
- $favicon = $this->fetcher->fetch($url);
+ $this->fetcher->fetch($url);
}
@@ -271,13 +267,11 @@ class FaviconFetcherTest extends \PHPUnit_Framework_TestCase {
$html = $this->getFaviconHTML($faviconPath);
$url = "http://a.b_c.de";
- $pageMock = $this->getFileMock($html);
- $pngMock = $this->getFileMock($this->png);
$this->fileFactory->expects($this->never())
->method('getFile');
- $favicon = $this->fetcher->fetch($url);
+ $this->fetcher->fetch($url);
}