Anton Grebnev
13 years ago
10 changed files with 212 additions and 85 deletions
-
11model/MongoDbCommand.php
-
5model/MongoDriver.php
-
19model/MongoModel.php
-
10model/MongoStatement.php
-
28tests/model/MongoDbCommandTest.php
-
22tests/model/MongoDriverTest.php
-
39tests/model/MongoStatementTest.php
-
60tests/model/MyDbDriver.php
-
43tests/model/MySQLiStatementTest.php
-
60tests/model/SqlModelTest.php
@ -0,0 +1,60 @@ |
|||
<?php |
|||
|
|||
abstract class MyDbDriver extends DbDriver |
|||
{ |
|||
public function getInsertId($table = null, $key = null) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
public function quoteIdentifier($param) |
|||
{ |
|||
return $param; |
|||
} |
|||
|
|||
public function quote($param) |
|||
{ |
|||
return $param; |
|||
} |
|||
|
|||
public function insert($table, $bind, $on_duplicate = array()) |
|||
{ |
|||
return $table; |
|||
} |
|||
|
|||
public function update($table, $bind, $where = '') |
|||
{ |
|||
return $table; |
|||
} |
|||
|
|||
public function delete($table, $where = '') |
|||
{ |
|||
return $table; |
|||
} |
|||
|
|||
public function query($sql, $params = array()) |
|||
{ |
|||
$conf = array('driver' => 'MockDbDriver', 'hostname' => 'somehost', 'database' => 'db', 'username' => 'test', 'password' => '1234'); |
|||
return new MockDbDriver($conf); |
|||
} |
|||
|
|||
public function execute() |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
public function fetch() |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
public function fetchField($field) |
|||
{ |
|||
return $field; |
|||
} |
|||
|
|||
public function fetchAll() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue