Skip to content

Commit

Permalink
Pluginクラスの名称をbaserCMS5.0系に合わせて調整、テスト実行時のマイグレーション処理を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Apr 7, 2024
1 parent 79aceb3 commit 85358c7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/Command/Bake/BcPluginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ protected function _generateFiles(
$template = substr($template, strrpos($template, 'Plugin' . DIRECTORY_SEPARATOR) + 7, -4);
$template = rtrim($template, '.');
$filename = $template;
if ($filename === 'src/Plugin.php') {
$filename = 'src/' . $name . 'Plugin.php';
}
// CUSTOMIZE ADD 2024/02/02 ryuring
// >>>
// if ($filename === 'src/Plugin.php') {
// $filename = 'src/' . $name . 'Plugin.php';
// }
if ($filename === 'src/ServiceProvider/ServiceProvider.php') {
$filename = 'src/ServiceProvider/' . $name . 'ServiceProvider.php';
}
Expand Down
2 changes: 1 addition & 1 deletion templates/bake/Plugin/src/Plugin.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Plugin for {{ namespace }}
*/
class {{ name }}Plugin extends BcPlugin
class Plugin extends BcPlugin
{
/**
* Load all the plugin configuration and bootstrap logic.
Expand Down
2 changes: 1 addition & 1 deletion templates/bake/Plugin/tests/bootstrap.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ if (file_exists($root . '/config/bootstrap.php')) {
* using migrations to provide schema for your plugin,
* and using \Migrations\TestSuite\Migrator to load schema.
*/
// (new Migrator())->runMany([]);
(new \Migrations\TestSuite\Migrator())->run(['plugin' => '{{ plugin }}']);
1 change: 0 additions & 1 deletion templates/bake/Plugin/tests/schema.sql.twig

This file was deleted.

0 comments on commit 85358c7

Please sign in to comment.