Skip to content

Commit a8f3e7e

Browse files
authored
Merge pull request #990 from cakephp/5.next-test-connection-aliasing
5.next: test connection aliasing
2 parents de9ee05 + a7a23b8 commit a8f3e7e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"homepage": "https://cakephp.org",
77
"require": {
88
"php": ">=8.1",
9-
"cakephp/cakephp": "^5.0.1",
9+
"cakephp/cakephp": "dev-5.next as 5.1.0",
1010
"cakephp/migrations": "^4.0.0",
1111
"cakephp/plugin-installer": "^2.0",
1212
"mobiledetect/mobiledetectlib": "^4.8.03"
@@ -16,7 +16,7 @@
1616
"cakephp/cakephp-codesniffer": "^5.0",
1717
"cakephp/debug_kit": "^5.0.0",
1818
"josegonzalez/dotenv": "^4.0",
19-
"phpunit/phpunit": "^10.1.0"
19+
"phpunit/phpunit": "^10.5.5"
2020
},
2121
"suggest": {
2222
"cakephp/repl": "Console tools for a REPL interface for CakePHP applications.",

tests/bootstrap.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Cake\Chronos\Chronos;
1919
use Cake\Core\Configure;
2020
use Cake\Datasource\ConnectionManager;
21+
use Cake\TestSuite\ConnectionHelper;
2122
use Migrations\TestSuite\Migrator;
2223

2324
/**
@@ -56,6 +57,10 @@
5657
// has been written to.
5758
session_id('cli');
5859

60+
// Connection aliasing needs to happen before migrations are run.
61+
// Otherwise, table objects inside migrations would use the default datasource
62+
ConnectionHelper::addTestAliases();
63+
5964
// Use migrations to build test database schema.
6065
//
6166
// Will rebuild the database if the migration state differs

0 commit comments

Comments
 (0)