Skip to content

Commit 6e7ee39

Browse files
Đỗ Văn HùngĐỗ Văn Hùng
authored andcommitted
テーマフォルダAPIとユニットテストのメソッドを追加
1 parent 15612a4 commit 6e7ee39

File tree

2 files changed

+216
-2
lines changed

2 files changed

+216
-2
lines changed

plugins/bc-theme-file/src/Controller/Api/ThemeFoldersController.php

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ThemeFoldersController extends BcApiController
3636
* @checked
3737
* @noTodo
3838
*/
39-
public function batch(ThemeFOldersServiceInterface $service)
39+
public function batch(ThemeFoldersServiceInterface $service)
4040
{
4141
$this->request->allowMethod(['post', 'put']);
4242
$allowMethod = [
@@ -50,7 +50,7 @@ public function batch(ThemeFOldersServiceInterface $service)
5050
}
5151
$targets = $this->getRequest()->getData('batch_targets');
5252
try {
53-
if(is_dir($targets[0])) {
53+
if (is_dir($targets[0])) {
5454
$fullpath = $targets[0];
5555
} else {
5656
$fullpath = dirname($targets[0]);
@@ -71,4 +71,92 @@ public function batch(ThemeFOldersServiceInterface $service)
7171
$this->viewBuilder()->setOption('serialize', ['message']);
7272
}
7373

74+
/**
75+
* テーマフォルダAPI 一覧取得
76+
*
77+
* @param ThemeFoldersServiceInterface $service
78+
* @return void
79+
*/
80+
public function index(ThemeFoldersServiceInterface $service)
81+
{
82+
//todo テーマフォルダAPI 一覧取得
83+
}
84+
85+
/**
86+
* テーマフォルダAPI テーマフォルダ新規追加
87+
*
88+
* @param ThemeFoldersServiceInterface $service
89+
* @return void
90+
*/
91+
public function add(ThemeFoldersServiceInterface $service)
92+
{
93+
//todo テーマフォルダAPI テーマフォルダ新規追加
94+
}
95+
96+
/**
97+
* テーマフォルダAPI テーマフォルダ編集
98+
*
99+
* @param ThemeFoldersServiceInterface $service
100+
* @return void
101+
*/
102+
public function edit(ThemeFoldersServiceInterface $service)
103+
{
104+
//todo テーマフォルダAPI テーマフォルダ編集
105+
}
106+
107+
/**
108+
* テーマフォルダAPI テーマフォルダ削除
109+
*
110+
* @param ThemeFoldersServiceInterface $service
111+
* @return void
112+
*/
113+
public function delete(ThemeFoldersServiceInterface $service)
114+
{
115+
//todo テーマフォルダAPI テーマフォルダ削除
116+
}
117+
118+
/**
119+
* テーマフォルダAPI テーマフォルダコピー
120+
*
121+
* @param ThemeFoldersServiceInterface $service
122+
* @return void
123+
*/
124+
public function copy(ThemeFoldersServiceInterface $service)
125+
{
126+
//todo テーマフォルダAPI テーマフォルダコピー
127+
}
128+
129+
/**
130+
* テーマフォルダAPI テーマフォルダアップロード
131+
*
132+
* @param ThemeFoldersServiceInterface $service
133+
* @return void
134+
*/
135+
public function upload(ThemeFoldersServiceInterface $service)
136+
{
137+
//todo テーマフォルダAPI テーマフォルダアップロード
138+
}
139+
140+
/**
141+
* テーマフォルダAPI 現在のテーマにテーマフォルダをコピー
142+
*
143+
* @param ThemeFoldersServiceInterface $service
144+
* @return void
145+
*/
146+
public function copy_to_theme(ThemeFoldersServiceInterface $service)
147+
{
148+
//todo テーマフォルダAPI 現在のテーマにテーマフォルダをコピー
149+
}
150+
151+
/**
152+
* テーマフォルダAPI フォルダを表示
153+
*
154+
* @param ThemeFoldersServiceInterface $service
155+
* @return void
156+
*/
157+
public function view(ThemeFoldersServiceInterface $service)
158+
{
159+
//todo テーマフォルダAPI フォルダを表示
160+
}
161+
74162
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?php
2+
/**
3+
* baserCMS : Based Website Development Project <https://basercms.net>
4+
* Copyright (c) NPO baser foundation <https://baserfoundation.org/>
5+
*
6+
* @copyright Copyright (c) NPO baser foundation
7+
* @link https://basercms.net baserCMS Project
8+
* @since 5.0.0
9+
* @license https://basercms.net/license/index.html MIT License
10+
*/
11+
12+
namespace BcThemeFile\Test\TestCase\Controller\Api;
13+
14+
use BaserCore\Test\Scenario\InitAppScenario;
15+
use BaserCore\TestSuite\BcTestCase;
16+
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait;
17+
18+
class ThemeFoldersControllerTest extends BcTestCase
19+
{
20+
21+
/**
22+
* ScenarioAwareTrait
23+
*/
24+
use ScenarioAwareTrait;
25+
26+
/**
27+
* Fixtures
28+
*
29+
* @var array
30+
*/
31+
public $fixtures = [
32+
'plugin.BaserCore.Factory/Sites',
33+
'plugin.BaserCore.Factory/SiteConfigs',
34+
'plugin.BaserCore.Factory/Users',
35+
'plugin.BaserCore.Factory/UsersUserGroups',
36+
'plugin.BaserCore.Factory/UserGroups',
37+
];
38+
39+
/**
40+
* set up
41+
*
42+
* @return void
43+
*/
44+
public function setUp(): void
45+
{
46+
parent::setUp();
47+
$this->loadFixtureScenario(InitAppScenario::class);
48+
$token = $this->apiLoginAdmin();
49+
$this->accessToken = $token['access_token'];
50+
$this->refreshToken = $token['refresh_token'];
51+
}
52+
53+
/**
54+
* tearDown
55+
*
56+
* @return void
57+
*/
58+
public function tearDown(): void
59+
{
60+
parent::tearDown();
61+
}
62+
63+
/**
64+
* [API] テーマフォルダ 一覧取得
65+
*/
66+
public function test_index()
67+
{
68+
$this->markTestIncomplete('このテストは未実装です。');
69+
}
70+
71+
/**
72+
* [API] テーマフォルダ テーマフォルダ新規追加
73+
*/
74+
public function test_add()
75+
{
76+
$this->markTestIncomplete('このテストは未実装です。');
77+
}
78+
79+
/**
80+
* [API] テーマフォルダ テーマフォルダ編集
81+
*/
82+
public function test_edit()
83+
{
84+
$this->markTestIncomplete('このテストは未実装です。');
85+
}
86+
87+
/**
88+
* [API] テーマフォルダ テーマフォルダ削除
89+
*/
90+
public function test_delete()
91+
{
92+
$this->markTestIncomplete('このテストは未実装です。');
93+
}
94+
95+
/**
96+
* [API] テーマフォルダ テーマフォルダコピー
97+
*/
98+
public function test_copy()
99+
{
100+
$this->markTestIncomplete('このテストは未実装です。');
101+
}
102+
103+
/**
104+
* [API] テーマフォルダ テーマフォルダアップロード
105+
*/
106+
public function test_upload()
107+
{
108+
$this->markTestIncomplete('このテストは未実装です。');
109+
}
110+
111+
/**
112+
* [API] テーマフォルダ テーマフォルダコピー
113+
*/
114+
public function test_copy_to_theme()
115+
{
116+
$this->markTestIncomplete('このテストは未実装です。');
117+
}
118+
119+
/**
120+
* [API] テーマフォルダ テーマフォルダを表示
121+
*/
122+
public function test_view()
123+
{
124+
$this->markTestIncomplete('このテストは未実装です。');
125+
}
126+
}

0 commit comments

Comments
 (0)