Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable module override when test. #12

Merged
merged 14 commits into from
Mar 28, 2023

Conversation

NaokiTsuchiya
Copy link
Member

@NaokiTsuchiya NaokiTsuchiya commented Mar 20, 2023

テスト実行時にモジュールをオーバライド可能にしました。

  • overrideModule が指定されている場合は、Injectorを生成
  • テストでは OverrideModule トレイトを使います。$this->app の型が親クラスに定義されており、上書きできないためこの方法にしています。

demoアプリに適用した際の差分は以下のとおりです。
https://github.com/koriym/hello-ray-di-for-laravel/compare/master...NaokiTsuchiya:feat/override-module?expand=1

@NaokiTsuchiya NaokiTsuchiya changed the title feat: Enable module override when test. Enable module override when test. Mar 20, 2023
@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (2d97eec) 100.00% compared to head (c058571) 100.00%.

❗ Current head c058571 differs from pull request most recent head cb2fb4a. Consider uploading reports for the commit cb2fb4a to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##                 1.x       #12   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        10        18    +8     
===========================================
  Files              2         3    +1     
  Lines             25        50   +25     
===========================================
+ Hits              25        50   +25     
Impacted Files Coverage Δ
src/Application.php 100.00% <100.00%> (ø)
src/Testing/OverrideModule.php 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

README.ja.md Outdated Show resolved Hide resolved
@koriym koriym merged commit fa40da9 into ray-di:1.x Mar 28, 2023
@NaokiTsuchiya NaokiTsuchiya deleted the feat/override-module branch March 28, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants