From 579344901a2573a3e5b671d1621d9386b90b7be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 25 Oct 2023 07:50:38 +0700 Subject: [PATCH 1/9] =?UTF-8?q?BcEditorTemplate=E3=82=92=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=AE=9F=E8=A1=8C=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpunit.xml.dist | 6 +++--- .../tests/TestCase/Service/EditorTemplatesServiceTest.php | 2 +- tests/bootstrap.php | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9f4c4005b1..6ecfbfa631 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,9 +21,9 @@ - - - + + plugins/bc-editor-template/tests/TestCase + diff --git a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php index 998eca259d..a16544ac52 100644 --- a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php @@ -58,7 +58,7 @@ public function testConstruct() */ public function testGetNew() { - $this->assertEquals($this->EditorTemplatesService->getNew()->toArray(), []); + $this->assertEquals($this->EditorTemplatesService->getNew()->toArray(), ['_bc_upload_id' => 1]); } /** diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6e7ad04708..44f9b0cb06 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -95,6 +95,7 @@ (new Migrator())->runMany([ ['plugin' => 'BaserCore'], ['plugin' => 'BcBlog'], + ['plugin' => 'BcEditorTemplate'], ['plugin' => 'BcSearchIndex'], ['plugin' => 'BcContentLink'], ['plugin' => 'BcMail'], From d4c4fb12f46836ee1e0e41734b7da604df9fa6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 25 Oct 2023 08:23:29 +0700 Subject: [PATCH 2/9] =?UTF-8?q?PluginsSeed=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../baser-core/config/Seeds/PluginsSeed.php | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/plugins/baser-core/config/Seeds/PluginsSeed.php b/plugins/baser-core/config/Seeds/PluginsSeed.php index e830cd8d98..f11a855256 100644 --- a/plugins/baser-core/config/Seeds/PluginsSeed.php +++ b/plugins/baser-core/config/Seeds/PluginsSeed.php @@ -42,6 +42,127 @@ public function run(): void 'priority' => '2', 'created' => NULL, 'modified' => NULL, + ], + [ + 'id' => '3', + 'name' => 'BcContentLink', + 'title' => 'BcContentLink', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '3', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '4', + 'name' => 'BcCustomContent', + 'title' => 'BcCustomContent', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '4', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '5', + 'name' => 'BcEditorTemplate', + 'title' => 'BcEditorTemplate', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '5', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '6', + 'name' => 'BcFavorite', + 'title' => 'BcFavorite', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '6', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '7', + 'name' => 'BcInstaller', + 'title' => 'BcInstaller', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '7', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '8', + 'name' => 'BcMail', + 'title' => 'BcMail', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '8', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '9', + 'name' => 'BcSearchIndex', + 'title' => 'BcSearchIndex', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '9', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '10', + 'name' => 'BcThemeConfig', + 'title' => 'BcThemeConfig', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '10', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '11', + 'name' => 'BcThemeFile', + 'title' => 'BcThemeFile', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '11', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '12', + 'name' => 'BcUploader', + 'title' => 'BcUploader', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '12', + 'created' => NULL, + 'modified' => NULL, + ], + [ + 'id' => '13', + 'name' => 'BcWidgetArea', + 'title' => 'BcWidgetArea', + 'version' => '2.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '13', + 'created' => NULL, + 'modified' => NULL, ] ]; From 438dad19f6ca1e316fe89c742427ec3bf73109dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 25 Oct 2023 10:11:54 +0700 Subject: [PATCH 3/9] =?UTF-8?q?PluginsSeed=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scenario/EditorTemplatesScenario.php | 6 +++--- .../Admin/EditorTemplatesControllerTest.php | 4 ++-- .../Admin/EditorTemplatesControllerTest.php | 10 +++++----- .../Service/EditorTemplatesServiceTest.php | 20 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/bc-editor-template/tests/Scenario/EditorTemplatesScenario.php b/plugins/bc-editor-template/tests/Scenario/EditorTemplatesScenario.php index d768c12378..e3ac72004e 100644 --- a/plugins/bc-editor-template/tests/Scenario/EditorTemplatesScenario.php +++ b/plugins/bc-editor-template/tests/Scenario/EditorTemplatesScenario.php @@ -27,7 +27,7 @@ class EditorTemplatesScenario implements FixtureScenarioInterface public function load(...$args) { EditorTemplateFactory::make([ - 'id' => '1', + 'id' => '11', 'name' => '画像(左)とテキスト', 'image' => 'template1.gif', 'description' => '画像を左に配置し、その右にテキストを配置するブロックです。', @@ -44,7 +44,7 @@ public function load(...$args) 'created' => '2015-01-27 12:56:52' ])->persist(); EditorTemplateFactory::make([ - 'id' => '2', + 'id' => '12', 'name' => '画像(右)とテキスト', 'image' => 'template2.gif', 'description' => '画像を右に配置し、その左にテキストを配置するブロックです。', @@ -61,7 +61,7 @@ public function load(...$args) 'created' => '2015-01-27 12:56:52' ])->persist(); EditorTemplateFactory::make([ - 'id' => '3', + 'id' => '13', 'name' => 'テキスト2段組', 'image' => 'template3.gif', 'description' => 'テキストを左右に2段組するブロックです。', diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php index 1a040d7ed3..4be1409f95 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php @@ -112,7 +112,7 @@ public function testBeforeEditEvent() $data = [ 'name' => 'japan' ]; - $this->post('/baser/admin/bc-editor-template/editor_templates/edit/1', $data); + $this->post('/baser/admin/bc-editor-template/editor_templates/edit/11', $data); $editorTemplates = $this->getTableLocator()->get('BcEditorTemplate.EditorTemplates'); $query = $editorTemplates->find()->where(['name' => 'beforeAdd']); $this->assertEquals(1, $query->count()); @@ -135,7 +135,7 @@ public function testAfterEditEvent() $data = [ 'name' => 'japan2' ]; - $this->post('/baser/admin/bc-editor-template/editor_templates/edit/1', $data); + $this->post('/baser/admin/bc-editor-template/editor_templates/edit/11', $data); $editorTemplates = $this->getTableLocator()->get('BcEditorTemplate.EditorTemplates'); $query = $editorTemplates->find()->where(['name' => 'afterAdd']); $this->assertEquals(1, $query->count()); diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php index 7376ca2694..d0cd3d445c 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php @@ -83,7 +83,7 @@ public function test_view() { //データを生成 $this->loadFixtureScenario(EditorTemplatesScenario::class); - $this->get('/baser/api/admin/bc-editor-template/editor_templates/view/1.json?token=' . $this->accessToken); + $this->get('/baser/api/admin/bc-editor-template/editor_templates/view/11.json?token=' . $this->accessToken); //ステータスを確認 $this->assertResponseOk(); //戻る値を確認 @@ -135,7 +135,7 @@ public function test_add() public function test_edit() { $this->loadFixtureScenario(EditorTemplatesScenario::class); - $this->post('/baser/api/admin/bc-editor-template/editor_templates/edit/1.json?token=' . $this->accessToken, ['name' => 'name edit']); + $this->post('/baser/api/admin/bc-editor-template/editor_templates/edit/11.json?token=' . $this->accessToken, ['name' => 'name edit']); //ステータスを確認 $this->assertResponseOk(); //戻る値を確認 @@ -152,7 +152,7 @@ public function test_edit() $this->assertEquals('データが見つかりません。', $result->message); //無効なIDを指定した場合、 - $this->post('/baser/api/admin/bc-editor-template/editor_templates/edit/1.json?token=' . $this->accessToken, ['name' => '']); + $this->post('/baser/api/admin/bc-editor-template/editor_templates/edit/11.json?token=' . $this->accessToken, ['name' => '']); //ステータスを確認 $this->assertResponseCode(400); //戻る値を確認 @@ -168,7 +168,7 @@ public function test_delete() { //データを生成 $this->loadFixtureScenario(EditorTemplatesScenario::class); - $this->post('/baser/api/admin/bc-editor-template/editor_templates/delete/1.json?token=' . $this->accessToken); + $this->post('/baser/api/admin/bc-editor-template/editor_templates/delete/11.json?token=' . $this->accessToken); //ステータスを確認 $this->assertResponseOk(); //戻る値を確認 @@ -198,6 +198,6 @@ public function test_list() $this->assertResponseOk(); //戻る値を確認 $result = json_decode((string)$this->_response->getBody()); - $this->assertEquals(get_object_vars($result->editorTemplates)[3], 'テキスト2段組'); + $this->assertEquals(get_object_vars($result->editorTemplates)[13], 'テキスト2段組'); } } diff --git a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php index a16544ac52..56d2885a2e 100644 --- a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php @@ -70,10 +70,10 @@ public function testGet() $this->loadFixtureScenario(EditorTemplatesScenario::class); //Getサービスをコル - $rs = $this->EditorTemplatesService->get(1); + $rs = $this->EditorTemplatesService->get(11); //戻る値を確認 - $this->assertEquals(1, $rs->id); + $this->assertEquals(11, $rs->id); $this->assertEquals('画像(左)とテキスト', $rs->name); } @@ -90,7 +90,7 @@ public function testGetIndex() //戻る値を確認 $this->assertEquals(3, $rs->count()); - $this->assertEquals(1, $rs->all()->toArray()[0]->id); + $this->assertEquals(11, $rs->all()->toArray()[0]->id); $this->assertEquals('画像(左)とテキスト', $rs->all()->toArray()[0]->name); } @@ -105,9 +105,9 @@ public function testGetList() $rs = $this->EditorTemplatesService->getList(); //期待値 $expect = [ - 1 => '画像(左)とテキスト', - 2 => '画像(右)とテキスト', - 3 => 'テキスト2段組', + 11 => '画像(左)とテキスト', + 12 => '画像(右)とテキスト', + 13 => 'テキスト2段組', ]; //期待値を戻るかどうか確認 $this->assertEquals($expect, $rs); @@ -140,7 +140,7 @@ public function testUpdate() //データを生成 $this->loadFixtureScenario(EditorTemplatesScenario::class); //対象メソッドをコル - $rs = $this->EditorTemplatesService->update($this->EditorTemplatesService->get(1), ['name' => 'edited']); + $rs = $this->EditorTemplatesService->update($this->EditorTemplatesService->get(11), ['name' => 'edited']); //エディターテンプレートの名前が変更されるか確認 $this->assertEquals('edited', $rs->name); @@ -148,7 +148,7 @@ public function testUpdate() $this->expectException('Cake\ORM\Exception\PersistenceFailedException'); $this->expectExceptionMessage('Entity save failure. Found the following errors (name.maxLength: "テンプレート名は50文字以内で入力してください。'); $data['name'] = str_repeat('a', 51); - $this->EditorTemplatesService->update($this->EditorTemplatesService->get(1), $data); + $this->EditorTemplatesService->update($this->EditorTemplatesService->get(11), $data); } /** @@ -159,13 +159,13 @@ public function testDelete() //データを生成 $this->loadFixtureScenario(EditorTemplatesScenario::class); //対象メソッドをコル - $rs = $this->EditorTemplatesService->delete(1); + $rs = $this->EditorTemplatesService->delete(11); //戻り値を確認 $this->assertTrue($rs); //削除したエディターテンプレートが存在しないか確認すること $this->expectException("Cake\Datasource\Exception\RecordNotFoundException"); - $this->EditorTemplatesService->get(1); + $this->EditorTemplatesService->get(11); } } From 9652968151e6cc1f0f3964ccf88f1eccf8a162b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 25 Oct 2023 19:14:30 +0700 Subject: [PATCH 4/9] =?UTF-8?q?PluginsSeed=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/Admin/EditorTemplatesControllerTest.php | 4 ++-- .../Controller/Api/Admin/EditorTemplatesControllerTest.php | 4 ++-- .../tests/TestCase/Service/EditorTemplatesServiceTest.php | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php index 4be1409f95..7358eca3f9 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php @@ -13,11 +13,11 @@ use BaserCore\Test\Scenario\InitAppScenario; use BaserCore\TestSuite\BcTestCase; +use BaserCore\Utility\BcContainerTrait; use BcEditorTemplate\Test\Scenario\EditorTemplatesScenario; use Cake\Datasource\ConnectionManager; use Cake\Event\Event; use Cake\ORM\TableRegistry; -use Cake\TestSuite\IntegrationTestTrait; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -30,7 +30,7 @@ class EditorTemplatesControllerTest extends BcTestCase * ScenarioAwareTrait */ use ScenarioAwareTrait; - use IntegrationTestTrait; + use BcContainerTrait; /** * set up diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php index d0cd3d445c..d313c49420 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php @@ -13,8 +13,8 @@ use BaserCore\Test\Scenario\InitAppScenario; use BaserCore\TestSuite\BcTestCase; +use BaserCore\Utility\BcContainerTrait; use BcEditorTemplate\Test\Scenario\EditorTemplatesScenario; -use Cake\TestSuite\IntegrationTestTrait; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -27,7 +27,7 @@ class EditorTemplatesControllerTest extends BcTestCase * ScenarioAwareTrait */ use ScenarioAwareTrait; - use IntegrationTestTrait; + use BcContainerTrait; /** * Access Token diff --git a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php index 56d2885a2e..df2b0cc05e 100644 --- a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php @@ -12,6 +12,7 @@ namespace BcEditorTemplate\Test\TestCase\Service; use BaserCore\TestSuite\BcTestCase; +use BaserCore\Utility\BcContainerTrait; use BcEditorTemplate\Service\EditorTemplatesService; use BcEditorTemplate\Test\Scenario\EditorTemplatesScenario; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; @@ -26,6 +27,7 @@ class EditorTemplatesServiceTest extends BcTestCase * ScenarioAwareTrait */ use ScenarioAwareTrait; + use BcContainerTrait; /** * set up From 07215a34ad0ebd51cca570612d56504a02a5dc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 25 Oct 2023 20:24:53 +0700 Subject: [PATCH 5/9] =?UTF-8?q?PluginsSeed=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestCase/Controller/Admin/EditorTemplatesControllerTest.php | 2 ++ .../Controller/Api/Admin/EditorTemplatesControllerTest.php | 2 ++ .../tests/TestCase/Service/EditorTemplatesServiceTest.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php index 7358eca3f9..d7e5715c13 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php @@ -18,6 +18,7 @@ use Cake\Datasource\ConnectionManager; use Cake\Event\Event; use Cake\ORM\TableRegistry; +use Cake\TestSuite\IntegrationTestTrait; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -31,6 +32,7 @@ class EditorTemplatesControllerTest extends BcTestCase */ use ScenarioAwareTrait; use BcContainerTrait; + use IntegrationTestTrait; /** * set up diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php index d313c49420..471628acfc 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php @@ -15,6 +15,7 @@ use BaserCore\TestSuite\BcTestCase; use BaserCore\Utility\BcContainerTrait; use BcEditorTemplate\Test\Scenario\EditorTemplatesScenario; +use Cake\TestSuite\IntegrationTestTrait; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -28,6 +29,7 @@ class EditorTemplatesControllerTest extends BcTestCase */ use ScenarioAwareTrait; use BcContainerTrait; + use IntegrationTestTrait; /** * Access Token diff --git a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php index df2b0cc05e..bdf95f09a7 100644 --- a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php @@ -15,6 +15,7 @@ use BaserCore\Utility\BcContainerTrait; use BcEditorTemplate\Service\EditorTemplatesService; use BcEditorTemplate\Test\Scenario\EditorTemplatesScenario; +use Cake\TestSuite\IntegrationTestTrait; use CakephpFixtureFactories\Scenario\ScenarioAwareTrait; /** @@ -28,6 +29,7 @@ class EditorTemplatesServiceTest extends BcTestCase */ use ScenarioAwareTrait; use BcContainerTrait; + use IntegrationTestTrait; /** * set up From f70c8fd1028ab7a7b92f03e7fb5dbc9db0355bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Thu, 26 Oct 2023 08:15:54 +0700 Subject: [PATCH 6/9] =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/Scenario/CustomTablesScenario.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php b/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php index 138d55954d..0c5fe8c331 100644 --- a/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php +++ b/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php @@ -11,8 +11,7 @@ namespace BcCustomContent\Test\Scenario; -use BcCustomContent\Test\Factory\CustomFieldFactory; -use BcCustomContent\Test\Factory\CustomLinkFactory; +use BaserCore\Test\Factory\PluginFactory; use BcCustomContent\Test\Factory\CustomTableFactory; use CakephpFixtureFactories\Scenario\FixtureScenarioInterface; @@ -28,6 +27,17 @@ class CustomTablesScenario implements FixtureScenarioInterface */ public function load(...$args) { + PluginFactory::make( [ + 'name' => 'BcCustomContent', + 'title' => 'カスタムコンテンツ', + 'version' => '1.0.0', + 'status' => '1', + 'db_init' => '1', + 'priority' => '1', + 'created' => '2021-05-03 10:57:07', + 'modified' => '2021-05-03 10:57:07' + ]); + CustomTableFactory::make([ 'id' => 1, 'type' => 1, From d8f027bf0fb03b6a049a2796618ffe612fdcbe7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Thu, 26 Oct 2023 08:16:19 +0700 Subject: [PATCH 7/9] =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/Scenario/CustomTablesScenario.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php b/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php index 0c5fe8c331..d64bf6f91c 100644 --- a/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php +++ b/plugins/bc-custom-content/tests/Scenario/CustomTablesScenario.php @@ -27,17 +27,6 @@ class CustomTablesScenario implements FixtureScenarioInterface */ public function load(...$args) { - PluginFactory::make( [ - 'name' => 'BcCustomContent', - 'title' => 'カスタムコンテンツ', - 'version' => '1.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '1', - 'created' => '2021-05-03 10:57:07', - 'modified' => '2021-05-03 10:57:07' - ]); - CustomTableFactory::make([ 'id' => 1, 'type' => 1, From 588f5c31d0548b7ba0cdc3daf217b77de78c6a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Mon, 30 Oct 2023 10:52:05 +0700 Subject: [PATCH 8/9] =?UTF-8?q?BcFavorite=E3=82=92=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=AE=9F=E8=A1=8C=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E3=81=AB=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestCase/Controller/Admin/EditorTemplatesControllerTest.php | 1 + .../Controller/Api/Admin/EditorTemplatesControllerTest.php | 1 + .../tests/TestCase/Service/EditorTemplatesServiceTest.php | 1 + 3 files changed, 3 insertions(+) diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php index d7e5715c13..353e11da69 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Admin/EditorTemplatesControllerTest.php @@ -53,6 +53,7 @@ public function setUp(): void public function tearDown(): void { parent::tearDown(); + $this->truncateTable('editor_templates'); } /** diff --git a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php index 471628acfc..5beb046bc5 100644 --- a/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Controller/Api/Admin/EditorTemplatesControllerTest.php @@ -62,6 +62,7 @@ public function setUp(): void public function tearDown(): void { parent::tearDown(); + $this->truncateTable('editor_templates'); } /** diff --git a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php index bdf95f09a7..c40a059b07 100644 --- a/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php +++ b/plugins/bc-editor-template/tests/TestCase/Service/EditorTemplatesServiceTest.php @@ -47,6 +47,7 @@ public function tearDown(): void { unset($this->EditorTemplatesService); parent::tearDown(); + $this->truncateTable('editor_templates'); } /** From a67513cdf09030b2c6e1a36dd8d341cafd10fb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=E1=BB=97=20V=C4=83n=20H=C3=B9ng?= Date: Wed, 1 Nov 2023 14:07:32 +0700 Subject: [PATCH 9/9] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../baser-core/config/Seeds/PluginsSeed.php | 121 ------------------ 1 file changed, 121 deletions(-) diff --git a/plugins/baser-core/config/Seeds/PluginsSeed.php b/plugins/baser-core/config/Seeds/PluginsSeed.php index f11a855256..e830cd8d98 100644 --- a/plugins/baser-core/config/Seeds/PluginsSeed.php +++ b/plugins/baser-core/config/Seeds/PluginsSeed.php @@ -42,127 +42,6 @@ public function run(): void 'priority' => '2', 'created' => NULL, 'modified' => NULL, - ], - [ - 'id' => '3', - 'name' => 'BcContentLink', - 'title' => 'BcContentLink', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '3', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '4', - 'name' => 'BcCustomContent', - 'title' => 'BcCustomContent', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '4', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '5', - 'name' => 'BcEditorTemplate', - 'title' => 'BcEditorTemplate', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '5', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '6', - 'name' => 'BcFavorite', - 'title' => 'BcFavorite', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '6', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '7', - 'name' => 'BcInstaller', - 'title' => 'BcInstaller', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '7', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '8', - 'name' => 'BcMail', - 'title' => 'BcMail', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '8', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '9', - 'name' => 'BcSearchIndex', - 'title' => 'BcSearchIndex', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '9', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '10', - 'name' => 'BcThemeConfig', - 'title' => 'BcThemeConfig', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '10', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '11', - 'name' => 'BcThemeFile', - 'title' => 'BcThemeFile', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '11', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '12', - 'name' => 'BcUploader', - 'title' => 'BcUploader', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '12', - 'created' => NULL, - 'modified' => NULL, - ], - [ - 'id' => '13', - 'name' => 'BcWidgetArea', - 'title' => 'BcWidgetArea', - 'version' => '2.0.0', - 'status' => '1', - 'db_init' => '1', - 'priority' => '13', - 'created' => NULL, - 'modified' => NULL, ] ];