Skip to content

FakeDba

Fake dba_driver implementation.

This is a subclass of the dba_pdo class, that essentially lets us inject a stub for the PDO class that is the actual database driver.

  • Full name: \Zotlabs\Tests\Fakes\FakeDba
  • Parent class: \dba_pdo

Methods

__construct

public __construct(mixed $stub): mixed

Parameters:

Parameter Type Description
$stub mixed

Inherited methods

connect

public connect(mixed $server, mixed $scheme, mixed $port, mixed $user, mixed $pass, mixed $db, mixed $db_charset): bool

Parameters:

Parameter Type Description
$server mixed DB server name
$scheme mixed DB scheme
$port mixed DB port
$user mixed DB username
$pass mixed DB password
$db mixed database name
$db_charset mixed

See Also:

  • \dba_driver::connect() -

q

public q(mixed $sql): bool|array|\PDOStatement

Parameters:

Parameter Type Description
$sql mixed The SQL query to execute

Return Value:

  • \b false if not connected or PDOException occured on query
  • \b array with results on a SELECT query
  • \b PDOStatement on a non SELECT SQL query

See Also:

  • \dba_driver::q() -

escape

public escape(mixed $str): mixed

Parameters:

Parameter Type Description
$str mixed The string to escape.

close

public close(): mixed

getdriver

public getdriver(): mixed

__construct

public __construct(mixed $server, mixed $scheme, mixed $port, mixed $user, mixed $pass, mixed $db, mixed $db_charset, mixed $install = false): mixed

Parameters:

Parameter Type Description
$server mixed
$scheme mixed
$port mixed
$user mixed
$pass mixed
$db mixed
$db_charset mixed
$install mixed

get_null_date

public get_null_date(): mixed

get_install_script

public get_install_script(): mixed

get_table_quote

public get_table_quote(): mixed

utcnow

public utcnow(): mixed

install

public install(mixed $server, mixed $scheme, mixed $port, mixed $user, mixed $pass, mixed $db): mixed

Parameters:

Parameter Type Description
$server mixed
$scheme mixed
$port mixed
$user mixed
$pass mixed
$db mixed

dbg

public dbg(int $dbg): mixed

Parameters:

Parameter Type Description
$dbg int 0 to disable debugging

__destruct

public __destruct(): mixed

quote_interval

public quote_interval(mixed $txt): mixed

Parameters:

Parameter Type Description
$txt mixed

optimize_table

public optimize_table(mixed $table): mixed

Parameters:

Parameter Type Description
$table mixed

concat

public concat(mixed $fld, mixed $sep): mixed

Parameters:

Parameter Type Description
$fld mixed
$sep mixed

escapebin

public escapebin(mixed $str): mixed

Parameters:

Parameter Type Description
$str mixed

unescapebin

public unescapebin(mixed $str): mixed

Parameters:

Parameter Type Description
$str mixed

use_index

public use_index(mixed $str): mixed

Parameters:

Parameter Type Description
$str mixed

str_to_date

public str_to_date(mixed $str): mixed

Parameters:

Parameter Type Description
$str mixed


Automatically generated on 2025-03-18