Skip to content

Commit

Permalink
Merge pull request #729 from cakephp/php84-ci
Browse files Browse the repository at this point in the history
Start update for php 8.4
  • Loading branch information
markstory authored Jul 26, 2024
2 parents 2a40e49 + c49679d commit 4f67527
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2']
php-version: ['8.1', '8.2', '8.3', '8.4']
db-type: [mysql, pgsql, sqlite]
prefer-lowest: ['']
cake_version: ['']
Expand Down Expand Up @@ -89,12 +89,13 @@ jobs:

- name: Composer install
run: |
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
if [[ ${{ matrix.php-version }} == '8.2' || ${{ matrix.php-version }} == '8.3' || ${{ matrix.php-version }} == '8.4' ]]; then
composer install --ignore-platform-req=php
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
composer update --prefer-lowest --prefer-stable
elif ${{ matrix.cake_version != '' }}; then
composer require --dev "cakephp/cakephp:${{ matrix.cake_version }}"
composer require --dev --with-all-dependencies "cakephp/bake:dev-3.next as 3.1.0"
composer update
else
composer update
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"robmorgan/phinx": "^0.16.0"
},
"require-dev": {
"cakephp/bake": "dev-3.next as 3.1.0",
"cakephp/cakephp": "dev-5.next as 5.1.0",
"cakephp/bake": "^3.0",
"cakephp/cakephp": "^5.0.3",
"cakephp/cakephp-codesniffer": "^5.0",
"phpunit/phpunit": "^10.1.0"
},
Expand Down
10 changes: 5 additions & 5 deletions src/Util/TableFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public function getTablesToBake(CollectionInterface $collection, array $options
}

if ($options['require-table'] === true || $options['plugin']) {
$tableNamesInModel = $this->getTableNames($options['plugin']);
$tableNamesInPlugin = $this->getTableNames($options['plugin']);

if (empty($tableNamesInModel)) {
if (empty($tableNamesInPlugin)) {
return [];
}

foreach ($tableNamesInModel as $num => $table) {
foreach ($tableNamesInPlugin as $num => $table) {
if ($table && str_contains($table, '.')) {
$split = array_reverse(explode('.', $table, 2));

Expand All @@ -88,10 +88,10 @@ public function getTablesToBake(CollectionInterface $collection, array $options
}

if (!in_array($table, $tables, true)) {
unset($tableNamesInModel[$num]);
unset($tableNamesInPlugin[$num]);
}
}
$tables = $tableNamesInModel;
$tables = $tableNamesInPlugin;
} else {
foreach ($tables as $num => $table) {
if (in_array($table, $this->skipTables, true) || (strpos($table, $this->skipTablesRegex) !== false)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Command/BakeMigrationDiffCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use function Cake\Core\env;

/**
* MigrationSnapshotTaskTest class
* BakeMigrationDiffCommandTest class
*/
class BakeMigrationDiffCommandTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Command/BakeMigrationSnapshotCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public function testSnapshotDiffWithAutoIdIncompatibleUnsignedPrimaryKeys(): voi
*/
public function testPluginBlog()
{
$this->loadPlugins(['TestBlog']);
$this->migrationPath = ROOT . DS . 'Plugin' . DS . 'TestBlog' . DS . 'config' . DS . 'Migrations' . DS;

$this->runSnapshotTest('PluginBlog', '-p TestBlog');
Expand Down Expand Up @@ -251,6 +252,7 @@ public function assertCorrectSnapshot($bakeName, $result)
public function testSnapshotWithNonDefaultCollation(): void
{
$this->skipIf(env('DB') !== 'mysql');
$this->loadPlugins(['SimpleSnapshot']);

$this->migrationPath = ROOT . DS . 'Plugin' . DS . 'SimpleSnapshot' . DS . 'config' . DS . 'Migrations' . DS;

Expand Down

0 comments on commit 4f67527

Please sign in to comment.