Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Command/ControllerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}

/**
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase/Command/EntryCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Command/FixtureCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase/Command/TemplateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([], [], []);
Expand All @@ -281,7 +281,7 @@ public function testGetTemplatePathPlugin()
$result = $command->getTemplatePath($args);
$this->assertPathEquals($pluginPath . 'templates/Admin/Posts/', $result);

$this->removePlugins(['TestTemplate']);
$this->removePlugins(['BakeTest']);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/TestCase/Command/TestCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
13 changes: 13 additions & 0 deletions tests/test_app/Plugin/Authentication/src/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);

namespace Authentication;

use Cake\Core\BasePlugin;

/**
* Plugin class stub for Authentication tests
*/
class AuthenticationPlugin extends BasePlugin
{
}
13 changes: 13 additions & 0 deletions tests/test_app/Plugin/BakeTest/src/BakeTestPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);

namespace BakeTest;

use Cake\Core\BasePlugin;

/**
* Plugin class stub for bake tests
*/
class BakeTestPlugin extends BasePlugin
{
}
9 changes: 9 additions & 0 deletions tests/test_app/Plugin/Company/Pastry/src/PastryPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace Company\Pastry;

use Cake\Core\BasePlugin;

class PastryPlugin extends BasePlugin
{
}
10 changes: 10 additions & 0 deletions tests/test_app/Plugin/TestBakeTheme/src/TestBakeThemePlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);

namespace TestBakeTheme;

use Cake\Core\BasePlugin;

class TestBakeThemePlugin extends BasePlugin
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);

namespace WithBakeSubFolder;

use Cake\Core\BasePlugin;

class WithBakeSubFolderPlugin extends BasePlugin
{
}
Loading