LGV_TZ_Lookup 1.4.2
Time zone lookup for PHP applications and HTTP clients
Loading...
Searching...
No Matches
databases.php File Reference

These are database integration tests for MySQL and PostgreSQL. More...

Go to the source code of this file.

Classes

class  DatabaseTestStatement
 This observes native PostgreSQL result sizes without keeping statements or cursors alive. PHP heap counters alone do not include libpq's result buffers. A weak reference lets the test inspect the active result and verify that it contains one row, while normal statement destruction still performs cleanup. More...

Functions

 databaseCheck ($expected, $actual, string $label)
 This checks a result and counts successful assertions.
 testDatabase (string $name, string $user, string $password, string $driver, string $host, int $port)
 This exercises the installed database and lookup classes in an isolated database. The function scope releases every test connection before the outer cleanup drops the PostgreSQL database.

Variables

if($driver==='pgsql') $admin
 $checks
 $driver
 $dsn
 $host
 $name
 $options
 $password
 $port
 $quote
 $user
if(!in_array( $driver,[ 'mysql', 'pgsql'], true)) if(isset($options['autoload'])) else
 finally
 try

Detailed Description

© Copyright 2023-2026, Little Green Viper Software Development LLC

LICENSE:

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Little Green Viper Software Development LLC

Run with –driver=mysql or –driver=pgsql. Connection overrides use LGV_TZ_TEST_HOST, PORT, USER, PASSWORD, and ADMIN_DATABASE. The tests create their own uniquely named database and remove it in a finally block. They check loading, binary encoding, lookup precedence, bounded row fetching, cursor cleanup, and transaction ownership. –autoload=/path/to/vendor/autoload.php runs the same checks against a Composer consumer installation.

Definition in file databases.php.

Function Documentation

◆ databaseCheck()

databaseCheck ( $expected,
$actual,
string $label )
Exceptions
RuntimeExceptionif values differ.

Definition at line 63 of file databases.php.

References $checks, and databaseCheck().

Referenced by databaseCheck().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testDatabase()

testDatabase ( string $name,
string $user,
string $password,
string $driver,
string $host,
int $port )
Exceptions
Exceptionif a database operation or assertion fails.

Definition at line 77 of file databases.php.

References $database, $driver, $host, $name, $password, $port, $user, $wrapper, and testDatabase().

Referenced by testDatabase().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ $admin

if ( $driver==='pgsql') $admin

Definition at line 215 of file databases.php.

Referenced by demoCreateDatabase().

◆ $checks

$checks

Definition at line 48 of file databases.php.

◆ $driver

◆ $dsn

$dsn

◆ $host

$host

Definition at line 209 of file databases.php.

Referenced by testDatabase().

◆ $name

$name

Definition at line 216 of file databases.php.

Referenced by demoCreateDatabase(), demoEnvironment(), deployIdentifier(), and testDatabase().

◆ $options

$options

Definition at line 37 of file databases.php.

◆ $password

$password

Definition at line 212 of file databases.php.

Referenced by testDatabase().

◆ $port

$port

Definition at line 210 of file databases.php.

Referenced by demoConnection(), and testDatabase().

◆ $quote

$quote

Definition at line 217 of file databases.php.

Referenced by demoCreateDatabase(), and deployIdentifier().

◆ $user

$user

Definition at line 211 of file databases.php.

Referenced by testDatabase().

◆ else

if(!in_array($driver, ['mysql', 'pgsql'], true)) if (isset( $options[ 'autoload'])) else

Definition at line 44 of file databases.php.

◆ finally

finally

Definition at line 222 of file databases.php.

◆ try

try

Definition at line 219 of file databases.php.