From a9427450393d282a46c5194a462bddd8f3ee97e8 Mon Sep 17 00:00:00 2001 From: Anton Grebnev Date: Tue, 6 Dec 2011 14:16:13 +0400 Subject: [PATCH] two TODO closed for exceptions --- model/MongoModel.php | 11 +---------- model/MySQLiStatement.php | 2 +- tests/model/MySQLiStatementTest.php | 3 +-- tests/model/SqlModelTest.php | 3 --- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/model/MongoModel.php b/model/MongoModel.php index cb433dc..91f2bf7 100644 --- a/model/MongoModel.php +++ b/model/MongoModel.php @@ -33,17 +33,11 @@ abstract class MongoModel extends Model return $this->db->delete($this->table(), array('_id' => $id)); } - /** - * @TODO: test method - */ public function deleteAll($query = array()) { $this->db->delete($this->table(), $query); } - - /** - * @TODO: check for limits (if just one record needed) - */ + protected function fetchField($data, $params = array(), $field, $cache_key = null) { if (!$cache_key || !$result = $cache_key->get()) { @@ -55,9 +49,6 @@ abstract class MongoModel extends Model return $result; } - /** - * @TODO: check for limits (if just one record needed) - */ protected function fetch($data, $params = array(), $cache_key = null) { if (!$cache_key || !$result = $cache_key->get()) { diff --git a/model/MySQLiStatement.php b/model/MySQLiStatement.php index b489899..0176cfd 100644 --- a/model/MySQLiStatement.php +++ b/model/MySQLiStatement.php @@ -25,7 +25,7 @@ class MySQLiStatement extends DbStatement } if (count($this->map) > 0) { if (!is_string($param) && !is_int($param)) { - throw new GeneralException('Placeholder must be an array or string'); + throw new GeneralException('Placeholder must be an integer or string'); } if (is_object($value) && ! ($value instanceof DbExpr)) { throw new GeneralException('Objects excepts DbExpr not allowed.'); diff --git a/tests/model/MySQLiStatementTest.php b/tests/model/MySQLiStatementTest.php index c50149d..9d7c4bc 100644 --- a/tests/model/MySQLiStatementTest.php +++ b/tests/model/MySQLiStatementTest.php @@ -64,8 +64,7 @@ class MySQLiStatementTest extends PHPUnit_Framework_TestCase /** * @expectedException GeneralException - * @expectedExceptionMessage Placeholder must be an array or string - * @TODO: change Exception Message 'Placeholder must be an array or string' - no arrays available + * @expectedExceptionMessage Placeholder must be an integer or string */ public function testBindParamExceptionParam() { diff --git a/tests/model/SqlModelTest.php b/tests/model/SqlModelTest.php index b09c6bb..5528c5f 100644 --- a/tests/model/SqlModelTest.php +++ b/tests/model/SqlModelTest.php @@ -92,9 +92,6 @@ class SqlModelTest extends PHPUnit_Framework_TestCase $this->assertSame(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name'), array('id', 'name'))); $this->assertEmpty($method->invoke($this->model, array())); - /** - * @TODO: Model::order - check DESC condition - make case insensitive - */ $this->assertSame(' ORDER BY name ASC', $method->invoke($this->model, array('sort' => 'name', 'order' => 'DESC'), array('id', 'name'))); }