Download the PHP package matthiasnoback/doctrine-orm-test-service-provider without Composer
On this page you can find all versions of the php package matthiasnoback/doctrine-orm-test-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download matthiasnoback/doctrine-orm-test-service-provider
More information about matthiasnoback/doctrine-orm-test-service-provider
Files in matthiasnoback/doctrine-orm-test-service-provider
Package doctrine-orm-test-service-provider
Short Description Service provider for tests in need of a Doctrine entity manager
License MIT
Homepage http://github.com/matthiasnoback/doctrine-orm-test-service-provider
Informations about the package doctrine-orm-test-service-provider
Doctrine ORM service provider for unit tests
This library contains a service provider to be used with a service container for PHPUnit tests.
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.
Of course, you would usually inject the entity manager into some object which is the subject-under-test.
To register Doctrine event listeners/subscribers, get the EventManager
instance by calling
$this->getEventManager()
. To get the database Connection
object, call $this->getConnection()
.
Read more
All versions of doctrine-orm-test-service-provider with dependencies
matthiasnoback/phpunit-test-service-container Version ^3.0
matthiasnoback/doctrine-dbal-test-service-provider Version ^3.0
doctrine/orm Version ^2.5
phpunit/phpunit Version ^6.0 || ^7.0 || ^8.0 || ^9.0