Jelix 1.8.13

UnitTestCaseDb extends UnitTestCase
in package

Tags

Table of Contents

$dbProfile  : string
profile name for jDb
$fakeServer  : ApacheMod
$needPDO  : bool
indicates if PDO is needed. If yes, PDO will be checked and if not present, tests will be skipped
_checkIdentical()  : mixed
assertComplexIdentical()  : mixed
assertComplexIdenticalStr()  : mixed
assertTableContainsRecords()  : mixed
check if all given record are in the table
assertTableContainsRecordsByKeys()  : mixed
check if all given record are in the table
assertTableHasNRecords()  : mixed
check if a table has a specific number of records
assertTableIsEmpty()  : mixed
check if the table is empty
assertTableIsNotEmpty()  : mixed
check if the table is not empty
emptyTable()  : mixed
erase all record in a table
getLastId()  : mixed
insertRecordsIntoTable()  : mixed
showTableContent()  : mixed
initClassicRequest()  : mixed
initialize a full jelix environment with a coordinator, a request object etc.
initJelixConfig()  : mixed
init jelix configuration.
setUp()  : void

Properties

$dbProfile

profile name for jDb

protected string $dbProfile = ''
Tags

$fakeServer

protected static ApacheMod $fakeServer = null
Tags

$needPDO

indicates if PDO is needed. If yes, PDO will be checked and if not present, tests will be skipped

protected bool $needPDO = false
Tags

Methods

_checkIdentical()

public _checkIdentical(mixed $xml, mixed $value, mixed $name, mixed $errormessage) : mixed
Parameters
$xml : mixed
$value : mixed
$name : mixed
$errormessage : mixed
Tags
Return values
mixed

assertComplexIdentical()

public assertComplexIdentical(mixed $value, mixed $file[, mixed $errormessage = '' ]) : mixed
Parameters
$value : mixed
$file : mixed
$errormessage : mixed = ''
Tags
Return values
mixed

assertComplexIdenticalStr()

public assertComplexIdenticalStr(mixed $value, mixed $string[, mixed $errormessage = '' ]) : mixed
Parameters
$value : mixed
$string : mixed
$errormessage : mixed = ''
Tags
Return values
mixed

assertTableContainsRecords()

check if all given record are in the table

public assertTableContainsRecords(mixed $table, mixed $records[, mixed $onlyThem = true ][, mixed $message = "%s" ]) : mixed
Parameters
$table : mixed
$records : mixed
$onlyThem : mixed = true
$message : mixed = "%s"
Tags
Return values
mixed

assertTableContainsRecordsByKeys()

check if all given record are in the table

public assertTableContainsRecordsByKeys(string $table, array<string|int, mixed> $records, array<string|int, mixed>|string $keys[, bool $onlyThem = true ][, string $message = "%s" ]) : mixed
Parameters
$table : string

the table name

$records : array<string|int, mixed>

the list of record we should find

$keys : array<string|int, mixed>|string

the list of key names of records

$onlyThem : bool = true

if true, check if the table has only this records

$message : string = "%s"

the error message

Tags
Return values
mixed

assertTableHasNRecords()

check if a table has a specific number of records

public assertTableHasNRecords(mixed $table, mixed $n[, mixed $message = "%s" ]) : mixed
Parameters
$table : mixed
$n : mixed
$message : mixed = "%s"
Tags
Return values
mixed

assertTableIsEmpty()

check if the table is empty

public assertTableIsEmpty(mixed $table[, mixed $message = "%s" ]) : mixed
Parameters
$table : mixed
$message : mixed = "%s"
Tags
Return values
mixed

assertTableIsNotEmpty()

check if the table is not empty

public assertTableIsNotEmpty(mixed $table[, mixed $message = "%s" ]) : mixed
Parameters
$table : mixed
$message : mixed = "%s"
Tags
Return values
mixed

emptyTable()

erase all record in a table

public emptyTable(mixed $table) : mixed
Parameters
$table : mixed
Tags
Return values
mixed

getLastId()

public getLastId(mixed $fieldName, mixed $tableName) : mixed
Parameters
$fieldName : mixed
$tableName : mixed
Tags
Return values
mixed

insertRecordsIntoTable()

public insertRecordsIntoTable(mixed $table, mixed $fields, mixed $records[, mixed $emptyBefore = false ]) : mixed
Parameters
$table : mixed
$fields : mixed
$records : mixed
$emptyBefore : mixed = false
Tags
Return values
mixed

showTableContent()

public showTableContent(mixed $table, mixed $fields[, mixed $order = '' ]) : mixed
Parameters
$table : mixed
$fields : mixed
$order : mixed = ''
Tags
Return values
mixed

initClassicRequest()

initialize a full jelix environment with a coordinator, a request object etc.

protected static initClassicRequest(string $url[, string $config = 'index/config.ini.php' ][, string $entryPoint = 'index.php' ]) : mixed

it initializes a coordinator, a classic request object. It sets \jApp::coord(),

Parameters
$url : string

the full requested URL (with http://, the domaine name etc.)

$config : string = 'index/config.ini.php'

the configuration file to use, as if you were inside an entry point

$entryPoint : string = 'index.php'

the entrypoint name as indicated into project.xml

Tags
Return values
mixed

initJelixConfig()

init jelix configuration.

protected static initJelixConfig([string $config = 'index/config.ini.php' ][, string $entryPoint = 'index.php' ]) : mixed

If you need to setup a full jelix environment with a coordinator, prefer to call initClassicRequest

Parameters
$config : string = 'index/config.ini.php'

the configuration file to use, as if you were inside an entry point

$entryPoint : string = 'index.php'

the entrypoint name as indicated into project.xml

Tags
Return values
mixed

setUp()

protected setUp() : void
Tags
Return values
void

Search results