From 874c469e0241962e15927de5aba758a7206849ba Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 12 May 2014 23:16:08 +0200 Subject: remove more dead code --- tests/unit/articleenhancer/EnhancerTest.php | 1 - tests/unit/businesslayer/BusinessLayerTest.php | 2 +- tests/unit/businesslayer/FeedBusinessLayerTest.php | 2 +- tests/unit/businesslayer/FolderBusinessLayerTest.php | 14 ++++---------- tests/unit/businesslayer/ItemBusinessLayerTest.php | 1 - tests/unit/controller/ItemApiControllerTest.php | 1 - tests/unit/db/EntityTest.php | 1 - tests/unit/db/FeedMapperTest.php | 11 +++++------ tests/unit/db/FolderMapperTest.php | 6 +++--- tests/unit/db/ItemMapperTest.php | 2 +- 10 files changed, 15 insertions(+), 26 deletions(-) diff --git a/tests/unit/articleenhancer/EnhancerTest.php b/tests/unit/articleenhancer/EnhancerTest.php index 31133dc4a..5c54816a8 100644 --- a/tests/unit/articleenhancer/EnhancerTest.php +++ b/tests/unit/articleenhancer/EnhancerTest.php @@ -46,7 +46,6 @@ class EnhancerTest extends \PHPUnit_Framework_TestCase { 'http://www.test.com' ); for ($i=0; $i < count($urls); $i++) { - $url = $urls[$i]; $this->articleEnhancer->expects($this->at($i)) ->method('enhance') ->with($this->equalTo($item)) diff --git a/tests/unit/businesslayer/BusinessLayerTest.php b/tests/unit/businesslayer/BusinessLayerTest.php index e6695f47f..8b9df37c0 100644 --- a/tests/unit/businesslayer/BusinessLayerTest.php +++ b/tests/unit/businesslayer/BusinessLayerTest.php @@ -66,7 +66,7 @@ class BusinessLayerTest extends \PHPUnit_Framework_TestCase { ->method('find') ->with($this->equalTo($id), $this->equalTo($user)); - $result = $this->newsBusinessLayer->find($id, $user); + $this->newsBusinessLayer->find($id, $user); } diff --git a/tests/unit/businesslayer/FeedBusinessLayerTest.php b/tests/unit/businesslayer/FeedBusinessLayerTest.php index 4cf0ae399..bd8e6fabd 100644 --- a/tests/unit/businesslayer/FeedBusinessLayerTest.php +++ b/tests/unit/businesslayer/FeedBusinessLayerTest.php @@ -374,7 +374,7 @@ class FeedBusinessLayerTest extends \PHPUnit_Framework_TestCase { ->will($this->throwException($ex)); $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerException'); - $return = $this->feedBusinessLayer->update($feed->getId(), $this->user); + $this->feedBusinessLayer->update($feed->getId(), $this->user); } diff --git a/tests/unit/businesslayer/FolderBusinessLayerTest.php b/tests/unit/businesslayer/FolderBusinessLayerTest.php index c66bb9453..e94a71ffa 100644 --- a/tests/unit/businesslayer/FolderBusinessLayerTest.php +++ b/tests/unit/businesslayer/FolderBusinessLayerTest.php @@ -100,15 +100,12 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue($rows)); $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerException'); - $result = $this->folderBusinessLayer->create($folderName, 'john', 3); + $this->folderBusinessLayer->create($folderName, 'john', 3); } public function testCreateThrowsExWhenFolderNameEmpty(){ $folderName = ''; - $rows = array( - array('id' => 1) - ); $this->folderMapper->expects($this->once()) ->method('findByName') @@ -116,7 +113,7 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue(array())); $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerValidationException'); - $result = $this->folderBusinessLayer->create($folderName, 'john', 3); + $this->folderBusinessLayer->create($folderName, 'john', 3); } @@ -172,15 +169,12 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue($rows)); $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerException'); - $result = $this->folderBusinessLayer->rename(3, $folderName, 'john'); + $this->folderBusinessLayer->rename(3, $folderName, 'john'); } public function testRenameThrowsExWhenFolderNameEmpty(){ $folderName = ''; - $rows = array( - array('id' => 1) - ); $this->folderMapper->expects($this->once()) ->method('findByName') @@ -188,7 +182,7 @@ class FolderBusinessLayerTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue(array())); $this->setExpectedException('\OCA\News\BusinessLayer\BusinessLayerException'); - $result = $this->folderBusinessLayer->rename(3, $folderName, 'john'); + $this->folderBusinessLayer->rename(3, $folderName, 'john'); } diff --git a/tests/unit/businesslayer/ItemBusinessLayerTest.php b/tests/unit/businesslayer/ItemBusinessLayerTest.php index 96faee440..930990350 100644 --- a/tests/unit/businesslayer/ItemBusinessLayerTest.php +++ b/tests/unit/businesslayer/ItemBusinessLayerTest.php @@ -59,7 +59,6 @@ class ItemBusinessLayerTest extends \PHPUnit_Framework_TestCase { $this->itemBusinessLayer = new ItemBusinessLayer($this->mapper, $statusFlag, $timeFactory, $config); $this->user = 'jack'; - $response = 'hi'; $this->id = 3; $this->updatedSince = 20333; $this->showAll = true; diff --git a/tests/unit/controller/ItemApiControllerTest.php b/tests/unit/controller/ItemApiControllerTest.php index 90f7a9680..7a90f5da4 100644 --- a/tests/unit/controller/ItemApiControllerTest.php +++ b/tests/unit/controller/ItemApiControllerTest.php @@ -346,7 +346,6 @@ class ItemApiControllerTest extends ControllerTestUtility { $response = $this->itemAPI->star(); - $data = $response->getData(); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); } diff --git a/tests/unit/db/EntityTest.php b/tests/unit/db/EntityTest.php index 8356e0336..9d41d6e82 100644 --- a/tests/unit/db/EntityTest.php +++ b/tests/unit/db/EntityTest.php @@ -88,7 +88,6 @@ class EntityTest extends \PHPUnit_Framework_TestCase { public function testSetterMarksFieldUpdated(){ - $id = 3; $this->entity->setId(3); $this->assertContains('id', $this->entity->getUpdatedFields()); diff --git a/tests/unit/db/FeedMapperTest.php b/tests/unit/db/FeedMapperTest.php index 35433bf31..5c2921063 100644 --- a/tests/unit/db/FeedMapperTest.php +++ b/tests/unit/db/FeedMapperTest.php @@ -84,7 +84,7 @@ class FeedMapperTest extends \OCA\News\Utility\MapperTestUtility { $this->setMapperResult($sql, $params); $this->setExpectedException('\OCA\News\Db\DoesNotExistException'); - $result = $this->mapper->find($id, $userId); + $this->mapper->find($id, $userId); } @@ -111,12 +111,11 @@ class FeedMapperTest extends \OCA\News\Utility\MapperTestUtility { $this->setMapperResult($sql, $params, $rows); $this->setExpectedException('\OCA\News\Db\MultipleObjectsReturnedException'); - $result = $this->mapper->find($id, $userId); + $this->mapper->find($id, $userId); } public function testFindAll(){ - $userId = 'john'; $rows = array( array('id' => $this->feeds[0]->getId()), array('id' => $this->feeds[1]->getId()) @@ -227,7 +226,7 @@ class FeedMapperTest extends \OCA\News\Utility\MapperTestUtility { array($urlHash, $this->user)); $this->setExpectedException('\OCA\News\Db\DoesNotExistException'); - $result = $this->mapper->findByUrlHash($urlHash, $this->user); + $this->mapper->findByUrlHash($urlHash, $this->user); } @@ -253,7 +252,7 @@ class FeedMapperTest extends \OCA\News\Utility\MapperTestUtility { array($urlHash, $this->user), $rows); $this->setExpectedException('\OCA\News\Db\MultipleObjectsReturnedException'); - $result = $this->mapper->findByUrlHash($urlHash, $this->user); + $this->mapper->findByUrlHash($urlHash, $this->user); } @@ -318,7 +317,7 @@ class FeedMapperTest extends \OCA\News\Utility\MapperTestUtility { array('id' => $this->feeds[0]->getId()), array('id' => $this->feeds[1]->getId()) ); - $deleteOlderThan = 110; + $sql = 'SELECT * FROM `*PREFIX*news_feeds` ' . 'WHERE `deleted_at` > 0 ' . 'AND `user_id` = ?'; diff --git a/tests/unit/db/FolderMapperTest.php b/tests/unit/db/FolderMapperTest.php index 5389800aa..c979f8ce0 100644 --- a/tests/unit/db/FolderMapperTest.php +++ b/tests/unit/db/FolderMapperTest.php @@ -67,7 +67,7 @@ class FolderMapperTest extends \OCA\News\Utility\MapperTestUtility { $this->setMapperResult($sql, array($id, $userId)); $this->setExpectedException('\OCA\News\Db\DoesNotExistException'); - $result = $this->folderMapper->find($id, $userId); + $this->folderMapper->find($id, $userId); } @@ -85,7 +85,7 @@ class FolderMapperTest extends \OCA\News\Utility\MapperTestUtility { $this->setMapperResult($sql, array($id, $userId), $rows); $this->setExpectedException('\OCA\News\Db\MultipleObjectsReturnedException'); - $result = $this->folderMapper->find($id, $userId); + $this->folderMapper->find($id, $userId); } @@ -185,7 +185,7 @@ class FolderMapperTest extends \OCA\News\Utility\MapperTestUtility { array('id' => $this->folders[0]->getId()), array('id' => $this->folders[1]->getId()) ); - $deleteOlderThan = 110; + $sql = 'SELECT * FROM `*PREFIX*news_folders` ' . 'WHERE `deleted_at` > 0 ' . 'AND `user_id` = ?'; diff --git a/tests/unit/db/ItemMapperTest.php b/tests/unit/db/ItemMapperTest.php index bddf8cd28..d9d6bf02c 100644 --- a/tests/unit/db/ItemMapperTest.php +++ b/tests/unit/db/ItemMapperTest.php @@ -389,7 +389,7 @@ class ItemMapperTest extends \OCA\News\Utility\MapperTestUtility { $this->setMapperResult($sql, $params, $rows); $this->setExpectedException('\OCA\News\Db\DoesNotExistException'); - $result = $this->mapper->getNewestItemId($this->user); + $this->mapper->getNewestItemId($this->user); } -- cgit v1.2.3