PHPackages                             facile-it/doctrine-test-module - 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. facile-it/doctrine-test-module

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

facile-it/doctrine-test-module
==============================

Laminas Framework module that provides features that help you run your Laminas-based App's testsuite more efficiently with isolated tests

1.0.0(9mo ago)021.7k↑58.8%2[1 PRs](https://github.com/facile-it/doctrine-test-module/pulls)MITPHPPHP ^8.1CI passing

Since Jul 17Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/facile-it/doctrine-test-module)[ Packagist](https://packagist.org/packages/facile-it/doctrine-test-module)[ Docs](https://github.com/facile-it/doctrine-test-module)[ RSS](/packages/facile-it-doctrine-test-module/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (12)Used By (0)

DoctrineTestModule
==================

[](#doctrinetestmodule)

Laminas module that provides features that help you run your Laminas App's testsuite more efficiently with isolated tests.

> Based on Symfony's [doctrine-test-bundle](https://github.com/dmaicher/doctrine-test-bundle).

It provides a `StaticDriver` that will wrap your originally configured `Driver` class (like `DBAL\Driver\PDOMysql\Driver`) and keeps a database connection statically in the current php process.

With the help of a PHPUnit extension class it will begin a transaction before every testcase and roll it back again after the test finished for all configured DBAL connections. This results in a performance boost as there is no need to rebuild the schema, import a backup SQL dump or re-insert fixtures before every testcase. As long as you avoid issuing DDL queries that might result in implicit transaction commits (Like `ALTER TABLE`, `DROP TABLE` etc; see [https://wiki.postgresql.org/wiki/Transactional\_DDL\_in\_PostgreSQL:\_A\_Competitive\_Analysis](https://wiki.postgresql.org/wiki/Transactional_DDL_in_PostgreSQL:_A_Competitive_Analysis)) your tests will be isolated and all see the same database state.

### How to install and use this Module?

[](#how-to-install-and-use-this-module)

1. install via composer

    ```
    composer require --dev facile-it/doctrine-test-module
    ```
2. Enable the module for your test environment in your `config/application.php`

    ```
