Skip to content

Commit

Permalink
ユニットテスト調整
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Nov 7, 2023
1 parent 6bf6011 commit 3fd0381
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function index(UploaderFilesServiceInterface $service)
* @param UploaderFilesServiceInterface $service
* @checked
* @noTodo
* @unitTest
*/
public function upload(UploaderFilesServiceInterface $service)
{
Expand Down
1 change: 0 additions & 1 deletion plugins/bc-uploader/src/Service/UploaderFilesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ public function update(EntityInterface $entity, array $postData)
* @return bool
* @checked
* @noTodo
* @unitTest
*/
public function isEditable(array $postData)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function test_index()
*/
public function test_upload()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
$pathTest = TMP . 'test' . DS;
$pathUpload = WWW_ROOT . DS . 'files' . DS . 'uploads' . DS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,22 +279,14 @@ public function test_update()
//正常系実行
$entity = $this->UploaderFilesService->update($entity, $postData);
$this->assertEquals('test.jpg', $entity->name);
//異常系実行
UploaderConfigFactory::make(['name' => 'use_permission', 'value' => true])->persist();
$postData = [
'user_id' => 99,
];
$this->expectException(BcException::class);
$this->UploaderFilesService->update($entity, $postData);


}

/**
* test isEditable
*/
public function test_isEditable()
{
$this->markTestIncomplete('こちらのテストはまだ未確認です');
//準備
UploaderConfigFactory::make(['name' => 'use_permission', 'value' => true])->persist();
// ログインしている状態、アップローダーファイルにuser_id が設定されていない
Expand Down

0 comments on commit 3fd0381

Please sign in to comment.