I am just working my way to some testing of an app. The goal is to increase the code coverage in general. Now I had to tweak a migration and want to write an integration test to check it.
Obviously, I need an object of type
\OC\DB\MigrationService to perform the migrations involved. If you have a better idea, please tell me.
- I can create a new instance of that class but I need an
OC\DB\Connection. How can I get that one?
- I could get the instance from the DI container. However, my attempt was disturbed by the fact that the generated
MigrationServicewas not built for the correct app (the app name was something generic). Any good advice?
I am aware that I should not use the private classes of the NC core but I need to tweak the tables/migrations. Also, the main code is free of private method calls, only the test code needs the
Ideally, you know of an app as an example that I can have a look at and I can clone their behavior. Thank you very much!