Skip to content

Commit 620d8a1

Browse files
authored
Remove phinx backend test from 5.x (#996)
* Remove phinx backend test from 5.x The phinx backend was removed in 5.x, so the test for MigrationsRollbackCommand is not applicable. This test was incorrectly merged from 4.x where phinx backend still exists. * Update PostgreSQL timestamp comparison file for 5.x - Update documentation URL from phinx to migrations/5 - Update timestamp type to timestampfractional for columns with precision/scale
1 parent 58e669c commit 620d8a1

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

tests/TestCase/MigrationsPluginTest.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,22 @@
44
namespace Migrations\Test\TestCase;
55

66
use Cake\Console\CommandCollection;
7-
use Cake\Core\Configure;
87
use Cake\TestSuite\TestCase;
9-
use Migrations\Command\MigrationsRollbackCommand;
108
use Migrations\Command\RollbackCommand;
119
use Migrations\MigrationsPlugin;
1210

1311
class MigrationsPluginTest extends TestCase
1412
{
1513
/**
16-
* Test that builtin backend uses RollbackCommand
14+
* Test that console() registers the correct RollbackCommand
1715
*/
18-
public function testConsoleBuiltinBackendUsesCorrectRollbackCommand(): void
16+
public function testConsoleUsesCorrectRollbackCommand(): void
1917
{
20-
Configure::write('Migrations.backend', 'builtin');
21-
2218
$plugin = new MigrationsPlugin();
2319
$commands = new CommandCollection();
2420
$commands = $plugin->console($commands);
2521

2622
$this->assertTrue($commands->has('migrations rollback'));
2723
$this->assertSame(RollbackCommand::class, $commands->get('migrations rollback'));
2824
}
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-
}
4725
}

tests/comparisons/Migration/test_snapshot_postgres_timestamp_tz_pgsql.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestSnapshotPostgresTimestampTzPgsql extends BaseMigration
99
* Up Method.
1010
*
1111
* More information on this method is available here:
12-
* https://book.cakephp.org/phinx/0/en/migrations.html#the-up-method
12+
* https://book.cakephp.org/migrations/5/en/migrations.html#the-up-method
1313
*
1414
* @return void
1515
*/
@@ -47,14 +47,14 @@ public function up(): void
4747
'limit' => null,
4848
'null' => true,
4949
])
50-
->addColumn('created', 'timestamp', [
50+
->addColumn('created', 'timestampfractional', [
5151
'default' => null,
5252
'limit' => null,
5353
'null' => true,
5454
'precision' => 6,
5555
'scale' => 6,
5656
])
57-
->addColumn('modified', 'timestamp', [
57+
->addColumn('modified', 'timestampfractional', [
5858
'default' => null,
5959
'limit' => null,
6060
'null' => true,
@@ -83,14 +83,14 @@ public function up(): void
8383
'limit' => 100,
8484
'null' => true,
8585
])
86-
->addColumn('created', 'timestamp', [
86+
->addColumn('created', 'timestampfractional', [
8787
'default' => null,
8888
'limit' => null,
8989
'null' => true,
9090
'precision' => 6,
9191
'scale' => 6,
9292
])
93-
->addColumn('modified', 'timestamp', [
93+
->addColumn('modified', 'timestampfractional', [
9494
'default' => null,
9595
'limit' => null,
9696
'null' => true,
@@ -194,14 +194,14 @@ public function up(): void
194194
'limit' => 10,
195195
'null' => true,
196196
])
197-
->addColumn('created', 'timestamp', [
197+
->addColumn('created', 'timestampfractional', [
198198
'default' => null,
199199
'limit' => null,
200200
'null' => true,
201201
'precision' => 6,
202202
'scale' => 6,
203203
])
204-
->addColumn('modified', 'timestamp', [
204+
->addColumn('modified', 'timestampfractional', [
205205
'default' => null,
206206
'limit' => null,
207207
'null' => true,
@@ -261,7 +261,7 @@ public function up(): void
261261
'limit' => null,
262262
'null' => true,
263263
])
264-
->addColumn('highlighted_time', 'timestamp', [
264+
->addColumn('highlighted_time', 'timestampfractional', [
265265
'default' => null,
266266
'limit' => null,
267267
'null' => true,
@@ -299,14 +299,14 @@ public function up(): void
299299
'limit' => 256,
300300
'null' => true,
301301
])
302-
->addColumn('created', 'timestamp', [
302+
->addColumn('created', 'timestampfractional', [
303303
'default' => null,
304304
'limit' => null,
305305
'null' => true,
306306
'precision' => 6,
307307
'scale' => 6,
308308
])
309-
->addColumn('updated', 'timestamp', [
309+
->addColumn('updated', 'timestampfractional', [
310310
'default' => null,
311311
'limit' => null,
312312
'null' => true,
@@ -359,7 +359,7 @@ public function up(): void
359359
* Down Method.
360360
*
361361
* More information on this method is available here:
362-
* https://book.cakephp.org/phinx/0/en/migrations.html#the-down-method
362+
* https://book.cakephp.org/migrations/5/en/migrations.html#the-down-method
363363
*
364364
* @return void
365365
*/

0 commit comments

Comments
 (0)