File: README_TESTING

package info (click to toggle)
php-horde-db 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,152 kB
  • sloc: php: 9,207; xml: 1,007; sql: 22; sh: 13; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
=====================
 Horde/Db Test Suite
=====================

:Authors:       Chuck Hagenbuch
:Authors:       Jan Schneider
:Contact:       dev@lists.horde.org

.. contents:: Contents
.. section-numbering::

Defining adapters
=================

As long as PHP has the PDO SQLite driver (which is enabled by default), the
SQLite tests will always be run. This is possible using the sqlite:memory
database; no file access or permissions are required.

For the other adapters, the Horde_Db test suite looks for the configuration
file conf.php, with an example configuration found at the conf.php.dist file,
or for environment variables named DB_ADAPTER_$driverName_TEST_CONFIG. For the
MySQLi driver, that would be DB_ADAPTER_MYSQLI_TEST_CONFIG. For the PDO
PostgreSQL driver, that would be DB_ADAPTER_PDO_PGSQL_TEST_CONFIG, and so
on. The value of the environment variable is a JSON string with the
configuration array for the adapter. Here is an example for setting up a test
DSN for the MySQL test database on localhost, connecting as the user horde_db
with no password:

{"username":"horde_db","dbname":"test","host":"localhost"}

When running the test suite, any adapter for which a DSN is not found, or for
which connecting to the defined DSN fails, a single instance of
Horde_Db_Adapter_MissingTest will be included in the test suite run, with
details on why the adapter was skipped.