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 | |
© 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.
| databaseCheck | ( | $expected, | |
| $actual, | |||
| string | $label ) |
| RuntimeException | if values differ. |
Definition at line 63 of file databases.php.
References $checks, and databaseCheck().
Referenced by databaseCheck().
| testDatabase | ( | string | $name, |
| string | $user, | ||
| string | $password, | ||
| string | $driver, | ||
| string | $host, | ||
| int | $port ) |
| Exception | if 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().
| if ( $driver==='pgsql') $admin |
Definition at line 215 of file databases.php.
Referenced by demoCreateDatabase().
| $checks |
Definition at line 48 of file databases.php.
| $driver |
Definition at line 38 of file databases.php.
Referenced by demoConnection(), demoCreateDatabase(), demoDriver(), deployConnection(), deployIdentifier(), LGV_TZ_Lookup_Setup\install(), testDatabase(), and updateConnection().
| $dsn |
Definition at line 213 of file databases.php.
Referenced by LGV_TZ_Lookup_PDO\__construct(), deployConnection(), and updateConnection().
| $host |
Definition at line 209 of file databases.php.
Referenced by testDatabase().
| $name |
Definition at line 216 of file databases.php.
Referenced by demoCreateDatabase(), demoEnvironment(), deployIdentifier(), and testDatabase().
| $options |
Definition at line 37 of file databases.php.
| $password |
Definition at line 212 of file databases.php.
Referenced by testDatabase().
| $port |
Definition at line 210 of file databases.php.
Referenced by demoConnection(), and testDatabase().
| $quote |
Definition at line 217 of file databases.php.
Referenced by demoCreateDatabase(), and deployIdentifier().
| $user |
Definition at line 211 of file databases.php.
Referenced by testDatabase().
Definition at line 44 of file databases.php.
| finally |
Definition at line 222 of file databases.php.
| try |
Definition at line 219 of file databases.php.