PHP Class MockDatabase

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

Protected Properties

Свойство Type Description
$expect array

Méthodes publiques

Méthode 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 méthode

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

beginTransaction() public méthode

public beginTransaction ( ) : boolean
Résultat boolean

column() public méthode

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

commit() public méthode

public commit ( ) : boolean
Résultat boolean

escapeValueSet() public méthode

public escapeValueSet ( array $values, string $type = 'string' ) : string
$values array
$type string
Résultat string

expect() public méthode

public expect ( string $statement = '', null $result = null ) : self
$statement string
$result null
Résultat self

factory() public static méthode

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

getExpected() public méthode

public getExpected ( string $statement = '' ) : mixed
$statement string
Résultat mixed

insert() public méthode

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

insertGet() public méthode

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

insertMany() public méthode

public insertMany ( string $table, array $maps ) : boolean
$table string
$maps array
Résultat boolean

row() public méthode

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

run() public méthode

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

safeQuery() public méthode

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

single() public méthode

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

update() public méthode

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

Property Details

$expect protected_oe property

protected array $expect
Résultat array