From e520306d544cb75704fbd0f584bd54d9d41ccb46 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 10 Jan 2026 23:05:23 -0500 Subject: [PATCH 1/2] Fix invalid schema --- tests/schema.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/schema.php b/tests/schema.php index b26ac345..5e650f4b 100644 --- a/tests/schema.php +++ b/tests/schema.php @@ -340,8 +340,8 @@ 'table' => 'datatypes', 'columns' => [ 'id' => ['type' => 'integer', 'null' => false], - 'decimal_field' => ['type' => 'decimal', 'length' => '6', 'precision' => 3, 'default' => '0.000'], - 'float_field' => ['type' => 'float', 'length' => '5,2', 'null' => false, 'default' => null], + 'decimal_field' => ['type' => 'decimal', 'length' => 6, 'precision' => 3, 'default' => '0.000'], + 'float_field' => ['type' => 'float', 'length' => 5, 'precision' => 2, 'null' => false, 'default' => null], 'huge_int' => ['type' => 'biginteger'], 'small_int' => ['type' => 'smallinteger'], 'tiny_int' => ['type' => 'tinyinteger'], From 2e7841493ddf5e75624301b1e219862701526c4e Mon Sep 17 00:00:00 2001 From: Mark Story Date: Sat, 10 Jan 2026 23:32:03 -0500 Subject: [PATCH 2/2] Fix deprecations from 5.3 --- composer.json | 4 ++++ tests/TestCase/Command/ControllerCommandTest.php | 2 +- tests/TestCase/Command/EntryCommandTest.php | 1 - tests/TestCase/Command/FixtureCommandTest.php | 6 +++--- tests/TestCase/Command/TemplateCommandTest.php | 8 ++++---- tests/TestCase/Command/TestCommandTest.php | 8 ++++---- .../Authentication/src/AuthenticationPlugin.php | 13 +++++++++++++ .../test_app/Plugin/BakeTest/src/BakeTestPlugin.php | 13 +++++++++++++ .../Plugin/Company/Pastry/src/PastryPlugin.php | 9 +++++++++ .../TestBakeTheme/src/TestBakeThemePlugin.php | 10 ++++++++++ .../src/WithBakeSubFolderPlugin.php | 10 ++++++++++ 11 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php create mode 100644 tests/test_app/Plugin/BakeTest/src/BakeTestPlugin.php create mode 100644 tests/test_app/Plugin/Company/Pastry/src/PastryPlugin.php create mode 100644 tests/test_app/Plugin/TestBakeTheme/src/TestBakeThemePlugin.php create mode 100644 tests/test_app/Plugin/WithBakeSubFolder/src/WithBakeSubFolderPlugin.php diff --git a/composer.json b/composer.json index 42926659..14d673fb 100644 --- a/composer.json +++ b/composer.json @@ -40,10 +40,14 @@ }, "autoload-dev": { "psr-4": { + "Authentication\\": "tests/test_app/Plugin/Authentication/src/", + "Authorization\\": "tests/test_app/Plugin/Authorization/src/", "BakeTest\\": "tests/test_app/Plugin/BakeTest/src/", "Bake\\Test\\": "tests/", "Bake\\Test\\App\\": "tests/test_app/App/", "Company\\Pastry\\": "tests/test_app/Plugin/Company/Pastry/src/", + "TestBake\\": "tests/test_app/Plugin/TestBake/src/", + "TestBakeTheme\\": "tests/test_app/Plugin/TestBakeTheme/src/", "WithBakeSubFolder\\": "tests/test_app/Plugin/WithBakeSubFolder/src/" } }, diff --git a/tests/TestCase/Command/ControllerCommandTest.php b/tests/TestCase/Command/ControllerCommandTest.php index ae6ec044..890ca9a8 100644 --- a/tests/TestCase/Command/ControllerCommandTest.php +++ b/tests/TestCase/Command/ControllerCommandTest.php @@ -68,7 +68,7 @@ public function tearDown(): void parent::tearDown(); $this->getTableLocator()->clear(); - $this->removePlugins(['ControllerTest', 'Company/Pastry', 'Authorization', 'BakeTest']); + $this->removePlugins(['Company/Pastry', 'Authorization', 'BakeTest']); } /** diff --git a/tests/TestCase/Command/EntryCommandTest.php b/tests/TestCase/Command/EntryCommandTest.php index 8832d4e6..27e013ee 100644 --- a/tests/TestCase/Command/EntryCommandTest.php +++ b/tests/TestCase/Command/EntryCommandTest.php @@ -57,7 +57,6 @@ public function testExecuteHelp() $this->exec('bake --help'); $this->assertExitCode(CommandInterface::CODE_SUCCESS); - $this->assertOutputContains('Available Commands'); $this->assertOutputContains('bake controller'); $this->assertOutputContains('bake controller all'); $this->assertOutputContains('bake command'); diff --git a/tests/TestCase/Command/FixtureCommandTest.php b/tests/TestCase/Command/FixtureCommandTest.php index a265731b..a0cb3928 100644 --- a/tests/TestCase/Command/FixtureCommandTest.php +++ b/tests/TestCase/Command/FixtureCommandTest.php @@ -200,10 +200,10 @@ public function testMainWithSingularTable() */ public function testMainWithPluginModel() { - $this->loadPlugins(['FixtureTest' => ['path' => APP . 'Plugin/FixtureTest/']]); + $this->loadPlugins(['TestBake' => ['path' => ROOT . 'Plugin/TestBake/']]); - $this->generatedFile = APP . 'Plugin/FixtureTest/tests/Fixture/ArticlesFixture.php'; - $this->exec('bake fixture --connection test FixtureTest.Articles'); + $this->generatedFile = ROOT . 'Plugin/TestBake/tests/Fixture/ArticlesFixture.php'; + $this->exec('bake fixture --connection test TestBake.Articles'); $this->assertExitCode(Command::CODE_SUCCESS); $this->assertFileContains('class ArticlesFixture', $this->generatedFile); diff --git a/tests/TestCase/Command/TemplateCommandTest.php b/tests/TestCase/Command/TemplateCommandTest.php index e730bf0d..428e9a49 100644 --- a/tests/TestCase/Command/TemplateCommandTest.php +++ b/tests/TestCase/Command/TemplateCommandTest.php @@ -264,12 +264,12 @@ public function testGetTemplatePath() */ public function testGetTemplatePathPlugin() { - $pluginPath = APP . 'Plugin/TestTemplate/'; - $this->loadPlugins(['TestTemplate' => ['path' => $pluginPath]]); + $pluginPath = APP . 'Plugin/BakeTest/'; + $this->loadPlugins(['BakeTest' => ['path' => $pluginPath]]); $command = new TemplateCommand(); $command->controllerName = 'Posts'; - $command->plugin = 'TestTemplate'; + $command->plugin = 'BakeTest'; // Use this->plugin as plugin could be in the name arg $args = new Arguments([], [], []); @@ -281,7 +281,7 @@ public function testGetTemplatePathPlugin() $result = $command->getTemplatePath($args); $this->assertPathEquals($pluginPath . 'templates/Admin/Posts/', $result); - $this->removePlugins(['TestTemplate']); + $this->removePlugins(['BakeTest']); } /** diff --git a/tests/TestCase/Command/TestCommandTest.php b/tests/TestCase/Command/TestCommandTest.php index b2552ce6..0cf8d59f 100644 --- a/tests/TestCase/Command/TestCommandTest.php +++ b/tests/TestCase/Command/TestCommandTest.php @@ -680,14 +680,14 @@ public function testTestCaseFileName($type, $class, $expected) public function testTestCaseFileNamePlugin() { $this->loadPlugins([ - 'TestTest' => [ - 'path' => APP . 'Plugin' . DS . 'TestTest' . DS, + 'TestBake' => [ + 'path' => APP . 'Plugin' . DS . 'TestBake' . DS, ], ]); $this->generatedFiles = [ - APP . 'Plugin/TestTest/tests/TestCase/Model/Entity/ArticleTest.php', + APP . 'Plugin/TestBake/tests/TestCase/Model/Entity/ArticleTest.php', ]; - $this->exec('bake test entity --plugin TestTest Article'); + $this->exec('bake test entity --plugin TestBake Article'); $this->assertExitCode(CommandInterface::CODE_SUCCESS); $this->assertFilesExist($this->generatedFiles); diff --git a/tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php b/tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php new file mode 100644 index 00000000..63ad67b8 --- /dev/null +++ b/tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php @@ -0,0 +1,13 @@ +