Conversation
| use Migrations\Db\Table\Index; | ||
| use Migrations\Db\Table\Table; | ||
|
|
||
| trait DefaultPdoAdapterTrait |
There was a problem hiding this comment.
We have a few places where we need a custom PDO instance which only returns specific values in specific cases. So I just added this trait to more easily make it possible to "mock" those instances without having to re-define all those methods.
|
The tests failing for MySQL indicates, that the changes in the Current 4.next of this repo is running fine: https://github.com/cakephp/migrations/actions/runs/10326114754 |
|
I found the Problem: inside our I remember there was something related to how plugins are loaded inside tests so the easiest fix was to load that test plugin inside that specific mysql test. And I guess this doesn't fail for the other DBMS's because we don't have the same test for the other versions. |
| $this->adapter = new class (['foo' => 'bar', 'version_order' => Config::VERSION_ORDER_CREATION_TIME]) extends PdoAdapter { | ||
| use DefaultPdoAdapterTrait; | ||
| }; |
There was a problem hiding this comment.
👏 This will be easier to maintain than phpunit mocks have been.
This has caused problems in the past as well. But scanning plugins that aren't loaded isn't something we do generally. I think the correct solution is to update the tests as you've done. |
This is a huge PR, so i tried to split things up via the commits:
Part 1: Fix PHPUnit Deprecations and convert mock classes to anonymous classes
Part 2: Fix small Migration specific deprecations
Part 3: Transform DataProviders and remove all
CoversannotationsPart 4: Fix
DependsannotationsI also noticed, that our CS fixer doesn't care / automatically fix annotations if they are written like this so this is something for our CS-Fixer