PHPackages                             webfactory/doctrine-orm-test-infrastructure - 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. webfactory/doctrine-orm-test-infrastructure

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

webfactory/doctrine-orm-test-infrastructure
===========================================

Provides utils to create a test infrastructure for Doctrine 2 entities.

2.2.0(5mo ago)2052.9k↓36.5%4[1 PRs](https://github.com/webfactory/doctrine-orm-test-infrastructure/pulls)1MITPHPPHP &gt;= 8.1CI passing

Since Sep 9Pushed 5mo ago9 watchersCompare

[ Source](https://github.com/webfactory/doctrine-orm-test-infrastructure)[ Packagist](https://packagist.org/packages/webfactory/doctrine-orm-test-infrastructure)[ RSS](/packages/webfactory-doctrine-orm-test-infrastructure/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (36)Used By (1)

doctrine-orm-test-infrastructure
================================

[](#doctrine-orm-test-infrastructure)

⚠️ This library is not receiving active maintenance anymore and is likely to be abandoned in the near future.

There have been major changes in the current Doctrine DBAL 3.x releases that make it increasingly hard to maintain helper classes that create a working ORM configuration "out of nothing". At the same time, we have been using the functionality provided here only to limited extent in our own projects. Most of the time, Symfony functional tests together with Zenstruck Foundry and testing against the real MySQL schema instead of an in-memory SQLite schema created ad hoc turned out to be good enough.

---

[![Tests](https://github.com/webfactory/doctrine-orm-test-infrastructure/workflows/Tests/badge.svg)](https://github.com/webfactory/doctrine-orm-test-infrastructure/workflows/Tests/badge.svg)

This library provides some infrastructure for tests of Doctrine ORM entities, featuring:

- configuration of a SQLite in memory database, compromising well between speed and a database environment being both realistic and isolated
- a mechanism for importing fixtures into your database that circumvents Doctrine's caching. This results in a more realistic test environment when loading entities from a repository.

[We](https://www.webfactory.de/) use it to test Doctrine repositories and entities in Symfony applications. It's a lightweight alternative to the heavyweight [functional tests suggested in the Symfony documentation](http://symfony.com/doc/current/cookbook/testing/doctrine.html)(we don't suggest you should skip those - we just want to open another path).

In non-application bundles, where functional tests are not possible, it is our only way to test repositories and entities.

Installation
------------

[](#installation)

Install via composer (see ):

```
composer require --dev webfactory/doctrine-orm-test-infrastructure

```

Usage
-----

[](#usage)

```
