diff --git a/composer.json b/composer.json index 42926659c..14d673fbe 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 ae6ec044d..890ca9a8c 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 8832d4e69..27e013ee9 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 a265731bd..a0cb3928f 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 e730bf0d4..428e9a490 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 b2552ce6f..0cf8d59f9 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/schema.php b/tests/schema.php index b26ac345e..5e650f4b1 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'], 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 000000000..63ad67b87 --- /dev/null +++ b/tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php @@ -0,0 +1,13 @@ +