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

$app['beforeTokenChecker'] のモジュール化 & ユニットテスト #19

Merged

Conversation

yuya-takeyama
Copy link
Contributor

無名関数として実装されていた $app['beforeTokenChecker'] をクラス化し、ユニットテストを書いています。
./src ディレクトリに移しているので、コードカバレッジの計測対象にも含まれるようになっています。

その他の特記事項は以下の通りです。

  • 定数 TokenValidTimeTOKEN_VALID_TIME に変更 (コーディング規約への対応)
  • DbInterfacefindUserById() メソッドを追加

TokenChecker が返すレスポンスについて、エラーメッセージが違うのではないかと思うもの (ユーザがデータベース上に見つからなかったとき) もありましたが、とりあえずはそのままにしています。

…ama/Spika-Server into feature/modular_token_checker

Conflicts:
	etc/app.php
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.75%) when pulling 30c4716 on yuya-takeyama:feature/modular_token_checker into 8a8fa8b on cloverstudio:develop.

@yuya-takeyama
Copy link
Contributor Author

fast-forward できなくなってたので git pull --rebase して送り直したらなんかテスト壊れちゃいましたね...
確認します

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 32ed79c on yuya-takeyama:feature/modular_token_checker into 8a8fa8b on cloverstudio:develop.

@yuya-takeyama
Copy link
Contributor Author

TokenChecker がちゃんと動作するようになったことで ReportControllerTest が引っかかってたので直しました。
TokenChecker を何もチェックしない偽物に置き換えることで対応してますが、もっとスマートに置き換えられる仕組みを考えた方がいいかもですね。。

cloverstudio pushed a commit that referenced this pull request Oct 20, 2013
$app['beforeTokenChecker'] のモジュール化 & ユニットテスト
@cloverstudio cloverstudio merged commit 8457bb9 into cloverstudio:develop Oct 20, 2013
@yuya-takeyama yuya-takeyama deleted the feature/modular_token_checker branch October 20, 2013 12:41
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.

None yet

3 participants