Skip to content
This repository was archived by the owner on Sep 15, 2022. It is now read-only.

Add option to choose Doctrine service name for Alice fixtures#190

Closed
michaelperrin wants to merge 1 commit intoKnpLabs:masterfrom
michaelperrin:feature/doctrine-service-option
Closed

Add option to choose Doctrine service name for Alice fixtures#190
michaelperrin wants to merge 1 commit intoKnpLabs:masterfrom
michaelperrin:feature/doctrine-service-option

Conversation

@michaelperrin
Copy link
Copy Markdown

This PR introduces MongoDB compatibility for FriendlyContexts Alice Context so that fixtures can be persisted in a project using MongoDB.

It more generally adds compatibility with any Doctrine manager, by allowing the user to give the Doctrine service name in the configuration (the default is kept to doctrine).

This is therefore more generic to the solution proposed in #136.

Here is an example:

default:
    # ...
    suites:
        # ...
    extensions:
        # ...
        Knp\FriendlyContexts\Extension:
            doctrine:
                service: 'doctrine_mongodb'

Comment thread doc/context-alice.md Outdated
```

Load all files
Load all files
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for trailing whitespace removal, but that's not that bad after all!

@vincentchalamon
Copy link
Copy Markdown
Contributor

Please add unit tests

$loader->clearCache()->willReturn(null);
$fixtures = [ 'User' => 'user.yml', 'Product' => 'product.yml', 'Place' => 'place.yml' ];
$config = [ 'alice' => [ 'fixtures' => $fixtures, 'dependencies' => [] ]];
$config = [ 'doctrine' => [ 'service' => 'doctrine' ], 'alice' => [ 'fixtures' => $fixtures, 'dependencies' => [] ]];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also run tests in this file, but with alternative configuration (like doctrine_mongodb)? Could be interesting to check its compatibility

@michaelperrin michaelperrin closed this by deleting the head repository Sep 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants