All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
This version represents a MAJOR change to the API and design of this library. You will NOT be able to simply upgrade to this version and keep everything working. It is HIGHLY recommended that you review the README for this version, which discusses the new design and how to get started.
- Created a new
Cspray\DatabaseTestin\DatabaseCleanup\CleanupStrategyinterface to allow more thorough control over how your database is prepared for tests. - Implemented a thorough "truncate tables" strategy, in addition to the existing "transaction with rollback".
- Renamed the namespace from
Cspray\DatabaseTestCasetoCspray\DatabaseTesting. - Updated the
ConnectionAdapterinterface to be more feature complete, to allow interacting with the database without assumption to the connection type.
- All concrete
ConnectionAdapterhave been removed. Adapter-specific library will be provided and should be used instead. - The PHPUnit-supported
DatabaseTestCasehas been removed. Testing framework-specific library will be provided and should be used instead.
- Allow all implemented database adapters to provide an existing connection.
- Allows the
AmpPostgresConnectionAdapterto use an existing connection
Cspray\DatabaseTestCase\AmpPostgresConnectionAdapterno longer prepares and executes insert statements in multiple steps. Makes direct use ofPostgresConnection::execute
0.2.0 - 2023-03-02
- Introduces a
Cspray\DatabaseTestCase\AbstractConnectionAdapterfor implementing functionality common across allCspray\DatabaseTestCase\ConnectionAdapterimplementations. - Provides the
Cspray\DatabaseTestCase\AmpPostgresConnectionAdapterfor working with the amphp/postgres library. - Adds support for MySQL in
Cspray\DatabaseTestCase\PdoConnecitonAdapter. The enumCspray\DatabaseTestCase\PdoDriverhas been updated to include this new option.
- The
Cspray\DatabaseTestCase\PdoConnectionAdapternow extends the newAbstractConnectionAdapterand has been simplified. - Added
declare(strict_types=1)in all files it was missing.
0.1.0 - 2023-03-02
- Adds a
Cspray\DatabaseTestCase\DatabaseTestCasethat allows for testing database interactions. - Adds a
Cspray\DatabaseTestCase\ConnectionAdapterinterface that is responsible for actual calls to an underlying connection. - Provides a
Cspray\DatabaseTestCase\PdoConnectionAdapterwith support for PostgreSQL databases. - Provides a mechanism for loading fixtures per test, using the Attribute
#[LoadFixture]and providing an implementation ofCspray\DatabaseTestCase\Fixture. - Provides a mechanism for retrieving the state of a database table at a given point in time with
Cspray\DatabaseTestCase\DatabaseRepresentation\Table.