|
4 | 4 | namespace Migrations\Test\TestCase; |
5 | 5 |
|
6 | 6 | use Cake\Console\CommandCollection; |
7 | | -use Cake\Core\Configure; |
8 | 7 | use Cake\TestSuite\TestCase; |
9 | | -use Migrations\Command\MigrationsRollbackCommand; |
10 | 8 | use Migrations\Command\RollbackCommand; |
11 | 9 | use Migrations\MigrationsPlugin; |
12 | 10 |
|
13 | 11 | class MigrationsPluginTest extends TestCase |
14 | 12 | { |
15 | 13 | /** |
16 | | - * Test that builtin backend uses RollbackCommand |
| 14 | + * Test that console() registers RollbackCommand |
17 | 15 | */ |
18 | | - public function testConsoleBuiltinBackendUsesCorrectRollbackCommand(): void |
| 16 | + public function testConsoleRegistersRollbackCommand(): void |
19 | 17 | { |
20 | | - Configure::write('Migrations.backend', 'builtin'); |
21 | | - |
22 | 18 | $plugin = new MigrationsPlugin(); |
23 | 19 | $commands = new CommandCollection(); |
24 | 20 | $commands = $plugin->console($commands); |
25 | 21 |
|
26 | 22 | $this->assertTrue($commands->has('migrations rollback')); |
27 | 23 | $this->assertSame(RollbackCommand::class, $commands->get('migrations rollback')); |
28 | 24 | } |
29 | | - |
30 | | - /** |
31 | | - * Test that phinx backend uses MigrationsRollbackCommand |
32 | | - * |
33 | | - * This is the reported bug in https://github.com/cakephp/migrations/issues/990 |
34 | | - */ |
35 | | - public function testConsolePhinxBackendUsesCorrectRollbackCommand(): void |
36 | | - { |
37 | | - Configure::write('Migrations.backend', 'phinx'); |
38 | | - |
39 | | - $plugin = new MigrationsPlugin(); |
40 | | - $commands = new CommandCollection(); |
41 | | - $commands = $plugin->console($commands); |
42 | | - |
43 | | - $this->assertTrue($commands->has('migrations rollback')); |
44 | | - // Bug: RollbackCommand is loaded instead of MigrationsRollbackCommand |
45 | | - $this->assertSame(MigrationsRollbackCommand::class, $commands->get('migrations rollback')); |
46 | | - } |
47 | 25 | } |
0 commit comments