VOOZH about

URL: https://deepwiki.com/stefanak-michal/php-bolt-driver/8-testing

⇱ Testing | stefanak-michal/php-bolt-driver | DeepWiki


Loading...
Last indexed: 14 February 2026 (a283bd)
Menu

Testing

This document provides an overview of the testing philosophy, test organization, and coverage strategy employed by the php-bolt-driver library. The testing infrastructure ensures compatibility across multiple database systems (Neo4j, Memgraph, NornicDB) and protocol versions (Bolt 1-6) using a comprehensive matrix testing approach.

For detailed information about specific testing layers, see:

Testing Philosophy

The php-bolt-driver library employs a multi-dimensional testing strategy that validates functionality across:

  • Multiple database systems: Neo4j (versions 4.4 through 2025), Memgraph, and NornicDB
  • Multiple PHP versions: PHP 8.2, 8.3, 8.4, and 8.5
  • Multiple protocol versions: Bolt 1 through Bolt 6
  • Multiple connection types: Socket, StreamSocket, and PStreamSocket with SSL/TLS variants

The testing approach separates concerns into unit tests (no database required) and integration tests (requiring live database connections), enabling rapid feedback during development while ensuring comprehensive end-to-end validation.

Sources: README.md35-43 phpunit.xml1-27

Test Suite Organization


Test Suite Composition Table

Suite NamePurposeDatabase RequiredTest Files Included
Neo4jFull integration testing with Neo4jYes (Neo4j)BoltTest.php, PerformanceTest.php, connection/, error/, packstream/, structures/
NoDatabaseUnit tests for core logicNoprotocol/, helpers/FileCacheTest.php
MemgraphMemgraph-specific compatibility testsYes (Memgraph)MemgraphTest.php
NornicDBNornicDB-specific compatibility testsYes (NornicDB)NornicDBTest.php

Sources: phpunit.xml3-22

Test Execution Flow


Sources: tests/BoltTest.php19-204 tests/TestLayer.php

Coverage Matrix

The library tests against an extensive matrix of database and PHP version combinations to ensure broad compatibility:

Neo4j Version Coverage

Neo4j VersionPHP Versions TestedWorkflow FileJobs per Run
4.48.2, 8.3, 8.4, 8.5neo4j.4.4.yml4
5.4, 5.6, 5.8, 5.12, 5.22, 5.25, 5.268.2, 8.3, 8.4, 8.5neo4j.5.yml28 (7 versions × 4 PHP)
2025.09, 20258.2, 8.3, 8.4, 8.5neo4j.2025.yml8 (2 versions × 4 PHP)

Total Neo4j test jobs per CI run: 40 combinations

Alternative Database Coverage

DatabaseVersionPHP VersionsWorkflow File
MemgraphLatest8.5memgraph.yml
NornicDBLatest8.5nornicdb.yml

Unit Test Coverage (No Database)

PHP VersionsWorkflow FilePurpose
8.2, 8.3, 8.4, 8.5no-db.ymlProtocol logic, PackStream serialization, cache operations

Sources: .github/workflows/neo4j.4.4.yml1-51 .github/workflows/neo4j.5.yml1-51 .github/workflows/neo4j.2025.yml1-51 .github/workflows/memgraph.yml1-37 .github/workflows/nornicdb.yml1-40 .github/workflows/no-db.yml1-35

Test Categories


Sources: phpunit.xml3-22

Key Test Files and Their Roles

Core Integration Tests

tests/BoltTest.php

Primary integration test file covering:

tests/PerformanceTest.php

Validates memory-efficient handling of large datasets using generator patterns for 50,000+ record result sets.

Sources: tests/BoltTest.php1-204 README.md164-165

Database-Specific Tests

tests/MemgraphTest.php

Memgraph compatibility suite testing:

tests/NornicDBTest.php

NornicDB compatibility suite testing:

Sources: tests/MemgraphTest.php1-153 tests/NornicDBTest.php1-177

Test Environment Configuration

Tests rely on global variables defined in phpunit.xml and optionally overridden via environment variables:

VariableDefault (phpunit.xml)CI OverridePurpose
NEO_USERneo4jGDB_USERNAME env varDatabase username
NEO_PASSnothing123GDB_PASSWORD env varDatabase password
NEO_HOSTSet by test contextService hostnameDatabase host address
NEO_PORTSet by test contextService port (7687)Database Bolt port

Sources: phpunit.xml23-26 .github/workflows/neo4j.5.yml47-50

CI Trigger Conditions

All GitHub Actions workflows execute when:

  • Pull requests are opened, synchronized, or reopened
  • Pull requests transition to ready-for-review state
  • Target branch is master
  • Pull request is not in draft mode

Draft pull requests are automatically skipped to conserve CI resources:


Sources: .github/workflows/neo4j.5.yml3-6 .github/workflows/neo4j.5.yml10

Test Execution Commands

The library provides multiple test execution modes depending on development needs:

Run all Neo4j integration tests:


Run unit tests without database:


Run database-specific compatibility tests:


Run specific test class:


Sources: .github/workflows/neo4j.5.yml46-50 .github/workflows/no-db.yml33-34

Testing Supported Ecosystems

The library validates compatibility with multiple graph database systems implementing the Bolt protocol:

DatabaseBolt Compatibility DocumentationTest Coverage
Neo4jbolt-compatibilityVersions 4.4-2025
Memgraphbolt-compatibilityLatest version
Amazon Neptunebolt-compatibilityNot actively tested
NornicDBCommunity contributionLatest version
DozerDBCommunity supportNot actively tested
ONgDBCommunity supportNot actively tested
LadybugDBVia bolt4rs wrapperNot actively tested

Systems marked "Not actively tested" are supported by the protocol implementation but lack dedicated CI jobs. Neo4j, Memgraph, and NornicDB receive continuous validation.

Sources: README.md35-43