-
Notifications
You must be signed in to change notification settings - Fork 13
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
Laravel module + Doctrine ORM cleanup not working #17
Comments
Have you got it working? Dependencies were messed up in that configuration. |
@TavoNiievez Would it be possible to implement DoctrineProvider interface in Laravel module? |
Absolutely yes. However, by far, that's not the biggest challenge. The most popular way to integrate the Doctrine ORM into Laravel is with the lavarel-doctrine project. There are complete but somewhat outdated guides with which you can achieve this in the test project, updating some things like the validation. To implement this method, we should also check that the integration of the Doctrine and Laravel modules works in their entirety. I can gladly guide the process if anyone is interested in forking the test project and integrating Doctrine for the two Laravel versions that are currently being tested ( From there the implementation of |
What's wrong with this issue is that, for some reason, the Adding the following makes both the Doctrine integration and the public function _getEntityManager()
{
if (!$this->client) {
$this->client = new LaravelConnector($this);
}
return $this->app['em'];
} and... public function _before(TestInterface $test)
{
$this->client = new LaravelConnector($this);
$this->getModule('Doctrine2')->_before($test);
}
public function _after(TestInterface $test)
{
$this->getModule('Doctrine2')->_after($test);
} Of course, this is not the best solution... But now that there is where to do tests ( https://github.com/TavoNiievez/laravel-module-tests/tree/doctrine ) it should be easier to solve these problems. |
What are you trying to achieve?
Rollback transactions between each test
What do you get instead?
Database changes not reverted
Details
composer show
)At the end the first test passed but the second one which is trying to insert the same db record fails and the previous one is not removed.
What's specific in this project is that is uses Laravel (6.18.13) with Doctrine (1.5 provided by laravel-doctrine/orm). I tried everything possible I could find without success.
What's obvious is [Database] Transaction started / [Database] Transaction cancelled; all changes reverted.
Could it be that the Laravel5 module only supports Eloquent?
Refering here https://codeception.com/for/laravel#functional-tests it is stated:
"Codeception will also use Eloquent to cleanup changes to database by wrapping tests into transaction and rolling it back in the end of a test. This makes tests isolated and fast. Laravel5 module allows to access services from DIC container, user authentication methods, fixture generators, check form validations and more."
If so what options do I have to make this work with Doctrine?
The text was updated successfully, but these errors were encountered: