#!/bin/bash
# dddream 套件測試腳本（本機執行）
# 用法：
#   ./test.sh              # 執行所有測試
#   ./test.sh unit         # 只執行 unit 測試
#   ./test.sh feature      # 只執行 feature 測試
#   ./test.sh room-type-feature  # 只執行 room-type-feature group 測試
#
# 若使用 Docker 開發環境，請從主專案根目錄執行，詳見 TEST.md「Docker 環境執行」章節。

cd "$(dirname "$0")"

case "$1" in
  unit)
    echo "執行 Unit 測試..."
    php vendor/bin/phpunit --testsuite unit --exclude-group skip --testdox --colors=always
    ;;
  feature)
    echo "執行 Feature 測試..."
    php vendor/bin/phpunit --testsuite feature --exclude-group skip --testdox --colors=always
    ;;
  room-type-feature)
    echo "執行 RoomTypeFeature 測試..."
    php vendor/bin/phpunit --testsuite unit --group room-type-feature --exclude-group skip --testdox --colors=always
    ;;
  *)
    echo "執行所有測試（跳過標記為 skip 的測試）..."
    php vendor/bin/phpunit --exclude-group skip --testdox --colors=always
    ;;
esac

