PHPackages                             mnewnham/adodb-unittest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mnewnham/adodb-unittest

ActiveProject[Testing &amp; Quality](/categories/testing)

mnewnham/adodb-unittest
=======================

A PHPUnit testing package for ADOdb

v1.3.0(1w ago)01MITPHPPHP ^8.3.0

Since Feb 13Pushed 2w agoCompare

[ Source](https://github.com/mnewnham/ADOdb-unittest)[ Packagist](https://packagist.org/packages/mnewnham/adodb-unittest)[ RSS](/packages/mnewnham-adodb-unittest/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (5)Versions (9)Used By (0)

ADODb Unit Tests
----------------

[](#adodb-unit-tests)

This is a standalone PHPUnit Unit Tester for the [ADOdb](https://adodb.org) database abstraction layer. It runs using any supported ADOdb database and performs tests against the driver and data dictionary for the database in use. It can be easily configured to run against multiple, side-by-side installations of ADOdb. For that reason, ADOdb is not included in the composer file. It can be found at [Github](https:/github.com/adodb/adodb) or at [Packagist](https://packagist.org/packages/adodb/adodb-php)

### Installation

[](#installation)

Easiest installed from Packagist as this will add PHPUnit as well, otherwise download the release code and use it

### Prerequsites

[](#prerequsites)

[PHPunit version 12+](https://phpunit.org) must be installed and running for this to work. Packagist will install it if you don't already have it. An ADOdb installation must be installed somewhere on the local file system, but that doesn't need any special installation.

- The unit tester requires access to a supported database via a configured ADOdb connection. The user requires privileges to add, change and delete tables, views and procedures as well as SELECT,CREATE,UPDATE,DELETE privileges on the created tables.
- To test the filesystem caching, write permission on the local filesystem is required
- To test memcache caching, access to a configured memcache server is required

### Current Coverage

[](#current-coverage)

  Core Data
Dictionary Meta
Functions Caching Active
Record XmlSchema Session
Management Stored
Procedures Driver
Specific
Tests mysqli ✔ ✔ ✔ ✔ ✔ ✔   ✔ mssqlnative ✔ ✔ ✔ ✔ ✔ ✔    sqlite3 ✔ ✔ ✔ ✔ ✔ ✔    postgres9 ✔ ✔ ✔ ✔ ✔ ✔   ✔ oci8 ✔ ✔ ✔ ✔ ✔ ✔   ✔  db2 ✔ ✔ ✔ ✔ ✔ ✔   ✔   PDO ✔ ✔ ✔ ✔ ✔ ✔    ### Setup

[](#setup)

Configuration information for the tests is held in a configuration file **adodb-unittest.ini**. The file can be located anywhere in the PHP include path. A template file with sample settings is available in **/tools/samples**

### Setting Up The Configuration File

[](#setting-up-the-configuration-file)

#### ADOdb Section

[](#adodb-section)

Add the ADOdb section and set the base directory for the ADOdb installation to test. If an ADOdb installation is included in the composer file, then that installation will effectively capture the test paths and only that installation can be tested.

Setting the casing activates the ADODB\_CASE value Setting the forcemode activates the ADODB\_FORCE\_MODE value

```
[ADOdb]
directory=/opt/some/local/ADOdb/installation

;0 ADODB_ASSOC_CASE_LOWER
;1 ADODB_ASSOC_CASE_UPPER
;2 ADODB_ASSOC_CASE_NATIVE
casing=1;
;ADODB_FORCE_IGNORE',0
;ADODB_FORCE_NULL',1
;ADODB_FORCE_EMPTY',2
;ADODB_FORCE_VALUE',3
;ADODB_FORCE_NULL_AND_ZERO',4
forcemode=0;

```

#### Driver Section

[](#driver-section)

Each database to test requires an entry. The entry name can be anything, the connection type is based on the driver entry in the section. You can add as many drivers to the configuration file as you want. The first driver found in the configuration file flagged **active** is tested.

```
[MySQL]
driver=mysqli
dsn=
host=mysql-server.com
user=root
password=somepassword
database=adodb-tester
debug=0
parameters=
active=1

```

SettingDescriptiondsnEither use a connection DSN or specify the parameters usualhostThe hostname associated with the databaseuserThe connection usernamepasswordThe connection passworddebugSets the debug modeparametersTo set parameters normally set by **setConnectionParameter()**&gt;, create a string in format **key=value;** Note that the parameters cannot be defined as Driver constants, you must use the numeric or string equivalentsactiveThe test is run against the first driver where the **active** flag is set to true#### Blob Section

[](#blob-section)

This section must be defined with the path names of 2 files:

1. A binary file to test BLOB handling, such as a jpeg file that can be used for read-write testing. If you use a very large size file, it may measurably slow down the test. If set to false or the file name is invalid, all BLOB tests are skipped.
2. A Plain text file to test CLOB handling. If set to false or the file name is invalid, all CLOB tests are skipped

```
[blob]
testBlob=c:/temp/someJpeg.jpg
testClob=c:/temp/someBigTextFile.txt

```

#### XMLschema Section

[](#xmlschema-section)

This section must be explicitly enabled in the configuration file, with the skipXmlTests value set to 0, otherwise all tests in the section are skipped. Setting the value to 1 will also skip the tests. Setting debug=1 in this section activates the extended debugging feature available in this module.

```
[xmlschema]
skipXmlTests=0
debug=0

```

#### Meta Section

[](#meta-section)

Unless explicitly enabled, the test to create a new database using the **createDatabase** method is skipped as it requires CREATE DATABASE privilege on the DBMS. To enable this test, set the following section:

```
[meta]
skipDbCreation=0

```

#### Active Record System

[](#active-record-system)

```
[activerecord]
skipTests=0
extended=0
quotefieldnames=false|UPPER|LOWER|BRACKETS

```

To test active-recordx.inc.php, set the extended flag to 1

#### Caching Section

[](#caching-section)

Unless explicitly enabled, cache functions such as **CacheExecute()** are skipped. Tests are supported using Filesystem based or memcache based caching. To activate this, add the following section to adodb-unittest.ini:

##### Filesystem Based Tests

[](#filesystem-based-tests)

```
[caching]
cacheMethod=1
cacheDir=c:/dev/cache

```

##### Memcache Based Tests

[](#memcache-based-tests)

```
[cache]
cacheMethod=2
cacheHost=192.168.1.50

```

To disable cache tests while leaving the section in place, ''set cacheMethod=0''

#### Stored Procedures

[](#stored-procedures)

Stored procedure testing must be explicitly enabled by adding a section and setting a parameter

```
[storedprocedures]
skipTests=0

```

#### Sessions Section

[](#sessions-section)

This section provides testing for the ADOdb session management system and requires access to a functioning webserver enabled for PHP

```
skipTests=0;
url=http://localhost/unittest
verbose=0
persist=P
compress=
encrypt=
clob=

```

- The url parameter points to a virtual directory that references ADOdb-Unittest/server
- verbose activates additionally debugging options. Note that these will generate warnings in the PHPUnit test
- persist (options: P - Persist, N - New Connection, C - Connect)
- compress (options: gzip, bz2)
- encrypt (options: crypt, sha1) \[secret only testable on linux\]
- clob (options: null, CLOB, BLOB) matches the type of sessdata column

Testing compression or encryption options requires use of a session schema file where the sessdata column is a BLOB storage field

#### Transactions Section

[](#transactions-section)

The tests ensure that a transaction has completed successfully if initiated. If this fails, the errors generated may obscure following errors. Set temporarily to expose those errors.

```
[transactions]
ignoreScopeErrors=1;

```

#### Globals Section

[](#globals-section)

To test some date functions, the local timezone must be equal to the server timezone. To change the timezone temporarily for the test, set the following global parameter in adodb-unittest.ini. This should exactly match the format in php.ini.

```
[globals]
date.timezone = 'America/Denver'

```

Any parameter saved into the **\[globals\]** section will be set using ini\_set()

### Test Execution

[](#test-execution)

Testing supports all of the standard PHPunit test methods. Every test must include the --bootstrap connection statement

#### Examples

[](#examples)

##### Complete System

[](#complete-system)

Approximately 80 tests with 1500 assertions

```
phpunit  /install-directory/ADOdb-unittest/src --bootstrap=/install-directory/ADOdb-unittest/tools/dbconnector.php

```

##### Testing just the data dictionary functions

[](#testing-just-the-data-dictionary-functions)

```
 phpunit  src/DataDict --bootstrap=tools/dbconnector.php

```

##### Testing a single function

[](#testing-a-single-function)

```
phpunit  src/Helpers/GetInsertSqlTest.php --bootstrap=tools/dbconnector.php

```

#### Driver Specific Tests

[](#driver-specific-tests)

If an ADOdb feature is not supported by all systems, e.g. MySQL bulk binding, the test is located in **/Drivers** directory

###  Health Score

42

↑

FairBetter than 88% of packages

Maintenance97

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~26 days

Total

8

Last Release

9d ago

Major Versions

v0.9.0-beta-3 → v1.0.12026-02-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/00fe18e150d6f136cd0205015408e13b4d35e0daa3d60b05ef38c7e90e15ebe9?d=identicon)[mnewnham](/maintainers/mnewnham)

---

Top Contributors

[![mnewnham](https://avatars.githubusercontent.com/u/4359245?v=4)](https://github.com/mnewnham "mnewnham (366 commits)")

---

Tags

adodbphpunit

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mnewnham-adodb-unittest/health.svg)

```
[![Health](https://phpackages.com/badges/mnewnham-adodb-unittest/health.svg)](https://phpackages.com/packages/mnewnham-adodb-unittest)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30314.4k7](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
