[Pkg-owncloud-commits] [owncloud] 03/172: fix scrutinizer issues

David Prévot taffit at moszumanska.debian.org
Sun May 18 20:09:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 93237d87ec5fdb54191bf3a75bd6d85992de6f39
Author: Bernhard Posselt <dev at bernhard-posselt.com>
Date:   Sat Apr 19 15:25:36 2014 +0200

    fix scrutinizer issues
---
 lib/public/appframework/db/entity.php    |  4 ++++
 tests/lib/appframework/db/EntityTest.php | 15 ++++++++++++++-
 tests/lib/appframework/db/MapperTest.php | 20 +++++++++-----------
 3 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/lib/public/appframework/db/entity.php b/lib/public/appframework/db/entity.php
index 6042cb9..631bf85 100644
--- a/lib/public/appframework/db/entity.php
+++ b/lib/public/appframework/db/entity.php
@@ -24,6 +24,10 @@
 namespace OCP\AppFramework\Db;
 
 
+/**
+ * @method integer getId()
+ * @method void setId(integer $id)
+ */
 abstract class Entity {
 
 	public $id;
diff --git a/tests/lib/appframework/db/EntityTest.php b/tests/lib/appframework/db/EntityTest.php
index 170bd04..28196d9 100644
--- a/tests/lib/appframework/db/EntityTest.php
+++ b/tests/lib/appframework/db/EntityTest.php
@@ -24,7 +24,20 @@
 namespace OCP\AppFramework\Db;
 
 
-
+/**
+ * @method integer getId()
+ * @method void setId(integer $id)
+ * @method integer getTestId()
+ * @method void setTestId(integer $id)
+ * @method string getName()
+ * @method void setName(string $name)
+ * @method string getName()
+ * @method void setEmail(string $email)
+ * @method string getEmail()
+ * @method void setEmailName(string $email)
+ * @method string getPreName()
+ * @method void setPreName(string $preName)
+ */
 class TestEntity extends Entity {
 	public $name;
 	public $email;
diff --git a/tests/lib/appframework/db/MapperTest.php b/tests/lib/appframework/db/MapperTest.php
index 2a7a370..015528d 100644
--- a/tests/lib/appframework/db/MapperTest.php
+++ b/tests/lib/appframework/db/MapperTest.php
@@ -38,10 +38,8 @@ class ExampleMapper extends Mapper {
 	public function __construct(IDb $db){ parent::__construct($db, 'table'); }
 	public function find($table, $id){ return $this->findOneQuery($table, $id); }
 	public function findOneEntity($table, $id){ return $this->findEntity($table, $id); }
-	public function findAll($table){ return $this->findAllQuery($table); }
 	public function findAllEntities($table){ return $this->findEntities($table); }
 	public function mapRow($row){ return $this->mapRowToEntity($row); }
-	public function pDeleteQuery($table, $id){ $this->deleteQuery($table, $id); }
 }
 
 
@@ -66,7 +64,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);
 	}
 
@@ -76,7 +74,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);
 	}
 
@@ -84,7 +82,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(
 			'\OCP\AppFramework\Db\DoesNotExistException');
 		$this->mapper->find($sql, $params);
@@ -94,7 +92,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(
 			'\OCP\AppFramework\Db\DoesNotExistException');
 		$this->mapper->findOneEntity($sql, $params);
@@ -106,7 +104,7 @@ class MapperTest extends MapperTestUtility {
 		$rows = array(
 			array('jo'), array('ho')
 		);
-		$row = $this->setMapperResult($sql, $params, $rows);
+		$this->setMapperResult($sql, $params, $rows);
 		$this->setExpectedException(
 			'\OCP\AppFramework\Db\MultipleObjectsReturnedException');
 		$this->mapper->find($sql, $params);
@@ -118,7 +116,7 @@ class MapperTest extends MapperTestUtility {
 		$rows = array(
 			array('jo'), array('ho')
 		);
-		$row = $this->setMapperResult($sql, $params, $rows);
+		$this->setMapperResult($sql, $params, $rows);
 		$this->setExpectedException(
 			'\OCP\AppFramework\Db\MultipleObjectsReturnedException');
 		$this->mapper->findOneEntity($sql, $params);
@@ -233,7 +231,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);
 	}
@@ -241,7 +239,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);
 	}
@@ -257,7 +255,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);
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list