test: TransactionManager nested cases + DataModelBase schema-driven behavior (#407)#415
Merged
Merged
Conversation
…ehavior (#407) 評価レポート (#401 § 3 Testing) 指摘の test coverage gap を補強。 ### TransactionManager 追加 3 cases 既存テスト (commit / rollback on throw / outer transaction preserved) に対して、nested run 系の missing scenarios を追加: 1. testNestedRunCommitsOuterTransactionOnlyOnce - 外 run() + 内 run() の両方 commit、内側は no-op に - boundary が 1 つに集約されることを assert 2. testNestedRunInnerExceptionRollsBackOuter - 内 run() 内 throw が outer まで bubble、外で rollback 1 回 + re-throw 3. testRollbackSkipsWhenTransactionAlreadyEnded - callback が pdo->commit() 自己発火 → throw した場合、manager の catch が double-rollback しないこと ### DataModelBase 新規 12 cases eval report が Phan baseline 5 件残存 + テストカバレッジ薄を指摘した DataModelBase の schema-driven magic を pin。fixture model (DataModelBaseTestFixtureModel) で constructor の Log/ErrorCode/RouteContext 依存を bypass し、schema-only 振る舞いに集中: - BOOLEAN / INTEGER / DOUBLE / STRING 各型の cast (4 cases) - 同型値の no-cast (1 case) - unknown property __set throw (1 case) - unknown property __get throw (1 case) - known but unset → null get (1 case) - __isset semantics (1 case) - toArray (1 case) - fromArray (1 case) - getSchema (1 case) ### DataMapperBase scope 外。PDO 依存が大きく、TestDouble の組み立てが今回の trial 範疇を 超えるため future PR で別途。 ### Verification - composer test 128/128 (113 → 128、+15 新) - composer test:http 24/24 (1 expected skip) - composer analyze (Phan) exit 0 - composer format:check exit 0 Closes #407. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
評価レポート #401 § 3 Testing 指摘の test coverage gap を補強。
TransactionManager: 3 nested 新 cases
既存の commit / throw rollback / outer-preserved 系に加えて nested run() 経路を追加:
DataModelBase: 12 新 cases (fixture model 経由)
eval report が「Phan baseline 5 件残存 + テスト薄」を指摘した `DataModelBase` の schema-driven magic を pin。`DataModelBaseTestFixtureModel` (parent::__construct skip して Log / ErrorCode / RouteContext 依存を回避) で schema-only 振る舞いを isolate:
DataMapperBase
scope 外 (PDO 依存が大きく future PR)。
Test plan
Closes #407.