PHPackages                             matthiasnoback/doctrine-orm-test-service-provider - 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. matthiasnoback/doctrine-orm-test-service-provider

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

matthiasnoback/doctrine-orm-test-service-provider
=================================================

Service provider for tests in need of a Doctrine entity manager

v3.1.0(8mo ago)164.8k↓48.9%3[1 issues](https://github.com/matthiasnoback/doctrine-orm-test-service-provider/issues)[2 PRs](https://github.com/matthiasnoback/doctrine-orm-test-service-provider/pulls)3MITPHPPHP ^7.1 || ^8.0CI failing

Since Dec 16Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/matthiasnoback/doctrine-orm-test-service-provider)[ Packagist](https://packagist.org/packages/matthiasnoback/doctrine-orm-test-service-provider)[ Docs](https://github.com/matthiasnoback/doctrine-orm-test-service-provider)[ RSS](/packages/matthiasnoback-doctrine-orm-test-service-provider/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (4)Versions (12)Used By (3)

Doctrine ORM service provider for unit tests
============================================

[](#doctrine-orm-service-provider-for-unit-tests)

[![CI](https://github.com/matthiasnoback/doctrine-orm-test-service-provider/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/matthiasnoback/doctrine-orm-test-service-provider/actions/workflows/ci.yml)

This library contains a service provider to be used with a [service container for PHPUnit tests](https://github.com/matthiasnoback/phpunit-test-service-container).

Usage
-----

[](#usage)

Use the trait `Noback\PHPUnitTestServiceContainer\PHPUnit\TestCaseWithEntityManager` in your test class. You then need to implement the `getEntityDirectories()` which should return an array of the directories containing the entities that should be loaded.

For each test method a connection to an SQLite database will be available. Also the schema for the given entities will be created automatically.

```
