Browse Source

two TODO closed for exceptions

master
Anton Grebnev 13 years ago
parent
commit
a942745039
  1. 11
      model/MongoModel.php
  2. 2
      model/MySQLiStatement.php
  3. 3
      tests/model/MySQLiStatementTest.php
  4. 3
      tests/model/SqlModelTest.php

11
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()) {

2
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.');

3
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()
{

3
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')));
}

Loading…
Cancel
Save