PHP Class MockDatabase

This is a mockery of our DB class! ... for testing purposes.
Inheritance: extends Airship\Engine\Database
Mostrar archivo Open project: paragonie/airship

Protected Properties

Property Type Description
$expect array

Public Methods

Method Description
__construct ( PDO $pdo = null, string $dbengine = '' ) Dependency-Injectable constructor
beginTransaction ( ) : boolean
column ( string $statement, array $params = [], integer $offset )
commit ( ) : boolean
escapeValueSet ( array $values, string $type = 'string' ) : string
expect ( string $statement = '', null $result = null ) : self
factory ( $dsn, string $username = '', string $password = '', $options = [] ) : Database
getExpected ( string $statement = '' ) : mixed
insert ( string $table, array $map = [] )
insertGet ( string $table, array $map, string $field )
insertMany ( string $table, array $maps ) : boolean
row ( string $statement, $params )
run ( string $statement, $params )
safeQuery ( string $statement, array $params = [], integer $fetch_style = PDO::FETCH_ASSOC )
single ( string $statement, array $params = [] )
update ( string $table, array $changes, array $conditions )

Method Details

__construct() public method

Dependency-Injectable constructor
public __construct ( PDO $pdo = null, string $dbengine = '' )
$pdo PDO
$dbengine string

beginTransaction() public method

public beginTransaction ( ) : boolean
return boolean

column() public method

public column ( string $statement, array $params = [], integer $offset )
$statement string
$params array
$offset integer

commit() public method

public commit ( ) : boolean
return boolean

escapeValueSet() public method

public escapeValueSet ( array $values, string $type = 'string' ) : string
$values array
$type string
return string

expect() public method

public expect ( string $statement = '', null $result = null ) : self
$statement string
$result null
return self

factory() public static method

public static factory ( $dsn, string $username = '', string $password = '', $options = [] ) : Database
$username string
$password string
return Airship\Engine\Database

getExpected() public method

public getExpected ( string $statement = '' ) : mixed
$statement string
return mixed

insert() public method

public insert ( string $table, array $map = [] )
$table string
$map array

insertGet() public method

public insertGet ( string $table, array $map, string $field )
$table string
$map array
$field string

insertMany() public method

public insertMany ( string $table, array $maps ) : boolean
$table string
$maps array
return boolean

row() public method

public row ( string $statement, $params )
$statement string

run() public method

public run ( string $statement, $params )
$statement string

safeQuery() public method

public safeQuery ( string $statement, array $params = [], integer $fetch_style = PDO::FETCH_ASSOC )
$statement string
$params array
$fetch_style integer

single() public method

public single ( string $statement, array $params = [] )
$statement string
$params array

update() public method

public update ( string $table, array $changes, array $conditions )
$table string
$changes array
$conditions array

Property Details

$expect protected_oe property

protected array $expect
return array