EC-CUBE / EC-CUBE/doc4.ec-cube.net

カスタマイズした機能に対してユニットテストする際のドキュメントが欲しい

Open
#311 1 comment 0 reactions 0 assignees View on GitHub
Customize good first issue
Dominant language
HTML
Stars
16
Forks
63
PR merge metrics
No merged PRs in 30d

Description

## 概要(Overview)
[eccube4の開発者向けドキュメント](https://doc4.ec-cube.net/)には、ユニットテストを自分で追加する際のやり方を指南するようなページが見当たりません。
そのため、既存の(eccubeに最適化された)コードをうまく活用するためには `app/Customize/config/` のテスト関連の設定や `phpunit.xml.dist` , その他 `Eccube\Tests\EccubeTestCase` などのコードを読む必要があります。
([symfonyのドキュメントのテスト項目](https://symfony.com/doc/current/testing.html)も必要に応じて参照)

個人的に、Customizeで機能の追加などをした時は以下の方法で該当箇所のユニットテストを実施しています。
- `tests/Customize/` ディレクトリを作成
- 上記ディレクトリ上に `Eccube\Tests\EccubeTestCase` を継承してテストクラスを作成
- 上記ディレクトリのテストのみ対象にする composer scripts を作成
- その他テストの設定等は基本変更なし( `app/Customize/config/**/*_test.yaml` , `app/Customize/config/**/test/*.yaml` )
- phpunit.xml.distの\には追加・修正を入れている

## 要望 (Requirement)
機能カスタマイズした際のユニットテストについて、テンプレ的なお作法や注意するポイント等を記載したドキュメントが欲しいです。
- ディレクトリ構成について
- eccubeのユニットテスト設定
- 注意点など
- 個人的には以下URLの内容で少し調査に時間がかかったので記載あると嬉しいです
- https://xoops.ec-cube.net/modules/newbb/viewtopic.php?viewmode=flat&order=ASC&topic_id=27576&forum=2

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.