merge mongo with master

This commit is contained in:
Anton Grebnev
2011-12-05 20:11:20 +04:00
72 changed files with 575 additions and 441 deletions

View File

@ -13,6 +13,7 @@
require_once dirname(__FILE__) . '/../../model/Db.php';
require_once dirname(__FILE__) . '/../../model/DbDriver.php';
require_once dirname(__FILE__) . '/../../model/DbStatement.php';
require_once dirname(__FILE__) . '/../../exception/GeneralException.php';
class DbStatementTest extends PHPUnit_Framework_TestCase
{
@ -54,16 +55,16 @@ class DbStatementTest extends PHPUnit_Framework_TestCase
->with($this->anything())
->will($this->returnCallback(array($this, 'dbStatementFetch')));
$this->assertEquals(11, $this->stmt->fetchField('one'));
$this->assertSame(11, $this->stmt->fetchField('one'));
$this->assertFalse($this->stmt->fetchField('zero'));
reset($this->testData);
$this->assertEquals(array(11, 21, 31), $this->stmt->fetchColumn('one'));
$this->assertSame(array(11, 21, 31), $this->stmt->fetchColumn('one'));
reset($this->testData);
$result = $this->stmt->fetchAll();
$this->assertEquals(11, $result[0]->one);
$this->assertEquals(32, $result[2]->two);
$this->assertSame(11, $result[0]->one);
$this->assertSame(32, $result[2]->two);
// reset($this->testData);
// $result = $this->stmt->fetchPairs();