From 937f025137cf511eba332260ea1ae876090b7d43 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 12 May 2014 23:26:59 +0200 Subject: remove more unused code --- tests/unit/businesslayer/FeedBusinessLayerTest.php | 5 ----- tests/unit/controller/FeedControllerTest.php | 8 -------- tests/unit/db/MapperTest.php | 24 ++++++++-------------- tests/unit/utility/FaviconFetcherTest.php | 12 +++-------- 4 files changed, 12 insertions(+), 37 deletions(-) (limited to 'tests') 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); } -- cgit v1.2.3