Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Symfony 5.4+ installation (bundles.php) #279

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,31 @@ It also includes a `Psr6StaticArrayCache` that will be automatically configured

1. install via composer

```sh
composer require --dev dama/doctrine-test-bundle
```

2. Enable the bundle for your test environment in your `AppKernel.php`

```php
if (in_array($env, ['dev', 'test'])) {
...
if ($env === 'test') {
$bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
}
}
```
```bash
composer require --dev dama/doctrine-test-bundle
```

Note: if you are using symfony flex and you are allowing contrib recipes (`extra.symfony.allow-contrib=true`) then the bundle will be automatically enabled for the `'test'` environment. See https://github.com/symfony/recipes-contrib/tree/master/dama/doctrine-test-bundle
2. If you're not using Flex, enable the bundle by adding the class to bundles.php
```php
<?php
// config/bundles.php

return [
//...
DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true],
//...
];
```

3. Starting from version 8 you need to make sure you have `use_savepoints` enabled on your doctrine DBAL configuration for all relevant connections:

```yaml
doctrine:
dbal:
connections:
default:
use_savepoints: true
```
```yaml
doctrine:
dbal:
connections:
default:
use_savepoints: true
```

#### Using the Bundle with PHPUnit

Expand Down
Loading