Skip to content

Commit

Permalink
コメントの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Nov 1, 2023
1 parent e289cf1 commit 8468981
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function edit(ThemeFilesAdminServiceInterface $service)
$this->BcMessage->setInfo(sprintf(__d('baser_core', 'ファイル %s を更新しました。'), $themeFile->name));
$this->redirect(array_merge(
[$args['theme'], $args['plugin'], $args['type']],
explode('/', dirname($args['path'])),
(str_contains($args['path'], '/'))? explode('/', dirname($args['path'])) : [],
[$themeFile->name]
));
} catch (BcFormFailedException $e) {
Expand Down Expand Up @@ -242,7 +242,7 @@ public function delete(ThemeFilesAdminServiceInterface $service)

$this->redirect(array_merge(
['action' => 'index', $args['theme'], $args['plugin'], $args['type']],
explode('/', dirname($args['path']))
(str_contains($args['path'], '/'))? explode('/', dirname($args['path'])) : []
));
}

Expand Down Expand Up @@ -270,7 +270,7 @@ public function delete_folder(ThemeFoldersAdminServiceInterface $service)

$this->redirect(array_merge(
['action' => 'index', $args['theme'], $args['plugin'], $args['type']],
explode('/', dirname($args['path']))
(str_contains($args['path'], '/'))? explode('/', dirname($args['path'])) : []
));
}

Expand Down Expand Up @@ -316,7 +316,7 @@ public function copy(ThemeFilesAdminServiceInterface $service)

$this->redirect(array_merge(
['action' => 'index', $args['theme'], $args['plugin'], $args['type']],
explode('/', dirname($args['path']))
(str_contains($args['path'], '/'))? explode('/', dirname($args['path'])) : []
));
}

Expand All @@ -343,7 +343,7 @@ public function copy_folder(ThemeFoldersAdminServiceInterface $service)

$this->redirect(array_merge(
['action' => 'index', $args['theme'], $args['plugin'], $args['type']],
explode('/', dirname($args['path']))
(str_contains($args['path'], '/'))? explode('/', dirname($args['path'])) : []
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function test_edit()
//戻る値を確認
$this->assertResponseCode(302);
$this->assertFlashMessage('ファイル base_name_2.php を更新しました。');
$this->assertRedirect(['action' => 'edit/BcThemeSample/layout/./base_name_2.php']);
$this->assertRedirect(['action' => 'edit/BcThemeSample/layout/base_name_2.php']);
unlink($fullpath . 'base_name_2.php');
}

Expand All @@ -235,7 +235,7 @@ public function test_delete()
//戻る値を確認
$this->assertResponseCode(302);
$this->assertFlashMessage('ファイル base_name_1.php を削除しました。');
$this->assertRedirect('/baser/admin/bc-theme-file/theme_files/index/BcColumn/layout/.');
$this->assertRedirect('/baser/admin/bc-theme-file/theme_files/index/BcColumn/layout');
//実際にファイルが削除されいてるか確認すること
$this->assertFalse(file_exists($fullpath . 'base_name_1.php'));
}
Expand All @@ -256,7 +256,7 @@ public function test_delete_folder()
//戻る値を確認
$this->assertResponseCode(302);
$this->assertFlashMessage('フォルダ delete_folder を削除しました。');
$this->assertRedirect('/baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout/.');
$this->assertRedirect('/baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout');
//実際にフォルダが削除されいてるか確認すること
$this->assertFalse(file_exists($fullpath . 'delete_folder'));
}
Expand Down Expand Up @@ -296,7 +296,7 @@ public function test_copy()
//戻る値を確認
$this->assertResponseCode(302);
$this->assertFlashMessage('ファイル default.php をコピーしました。');
$this->assertRedirect('baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout/.');
$this->assertRedirect('baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout');
unlink($fullpath . 'default_copy.php');
}

Expand All @@ -317,7 +317,7 @@ public function test_copy_folder()
//戻る値を確認
$this->assertResponseCode(302);
$this->assertFlashMessage('フォルダ new_folder をコピーしました。');
$this->assertRedirect('baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout/.');
$this->assertRedirect('baser/admin/bc-theme-file/theme_files/index/BcThemeSample/layout');

//テスト後に不要なフォルダーを削除
$folder->delete();
Expand Down

0 comments on commit 8468981

Please sign in to comment.