PHP Class Elgg\Mocks\Database

Inheritance: extends Elgg\Database
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Свойство Type Description
$last_insert_id integer

Méthodes publiques

Méthode Description
__construct ( Elgg\Database\Config $config, Logger $logger = null )
addQuerySpec ( array $spec ) : integer Set the result of a query that may be called in the future
clearQuerySpecs ( ) : void Remove all query specifications
connect ( $type = "readwrite" )
executeDatabaseQuery ( string $sql, array $params = [] ) : PHPUnit_Framework_MockObject_MockObject Execute database query
getConnection ( $type )
removeQuerySpec ( integer $id ) : void Remove a specified query added by addQuerySpec()
sanitizeString ( $value )
setupConnections ( )

Private Methods

Méthode Description
normalizeSql ( string $query ) : string Attempt to normalize whitespace in a query

Method Details

__construct() public méthode

public __construct ( Elgg\Database\Config $config, Logger $logger = null )
$config Elgg\Database\Config
$logger Elgg\Logger

addQuerySpec() public méthode

Set the result of a query that may be called in the future
public addQuerySpec ( array $spec ) : integer
$spec array Query spec
Résultat integer ID of spec

clearQuerySpecs() public méthode

Remove all query specifications
public clearQuerySpecs ( ) : void
Résultat void

connect() public méthode

public connect ( $type = "readwrite" )

executeDatabaseQuery() public méthode

Execute database query
public executeDatabaseQuery ( string $sql, array $params = [] ) : PHPUnit_Framework_MockObject_MockObject
$sql string Query
$params array Query params
Résultat PHPUnit_Framework_MockObject_MockObject (statement)

getConnection() public méthode

public getConnection ( $type )

removeQuerySpec() public méthode

Remove a specified query added by addQuerySpec()
public removeQuerySpec ( integer $id ) : void
$id integer Query spec ID
Résultat void

sanitizeString() public méthode

public sanitizeString ( $value )

setupConnections() public méthode

public setupConnections ( )

Property Details

$last_insert_id public_oe property

public int $last_insert_id
Résultat integer