simplesamlphp / simplesamlphp/simplesamlphp-test-framework

test module with redirectTrustedURL

未關閉
#3 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
PHP
星號
0
分支
2
PR 合併指標
30 天內沒有已合併 PR

描述

I am trying to write some unit tests to https://github.com/simplesamlphp/simplesamlphp-module-expirycheck/

is it possible to test Auth\ProcessingFilter in a module which uses a $httpUtils->redirectTrustedURL?

$filter->process($request);

https://github.com/simplesamlphp/simplesamlphp-module-expirycheck/blob/211ed0f229df807e3def38d55d1a42c89e406a04/src/Auth/Process/ExpiryDate.php#L191

throws this exception

InvalidArgumentException: Unable to parse base url: http://localhost

/xxx/simplesamlphp-module-expirycheck/vendor/simplesamlphp/simplesamlphp/src/SimpleSAML/Utils/HTTP.php:1011
/xxx/simplesamlphp-module-expirycheck/vendor/simplesamlphp/simplesamlphp/src/SimpleSAML/Utils/HTTP.php:886
/xxx/simplesamlphp-module-expirycheck/vendor/simplesamlphp/simplesamlphp/src/SimpleSAML/Utils/HTTP.php:954
/xxx/simplesamlphp-module-expirycheck/src/Auth/Process/ExpiryDate.php:191
/xxx/simplesamlphp-module-expirycheck/tests/src/Auth/Process/ExpiryDateTest.php:170

ERRORS!
Tests: 17, Assertions: 40, Errors: 1, Warnings: 1.

any help is welcome

Regards

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先在 tests/src/Auth/Process/ExpiryDateTest.php 中重現失敗,然後追蹤從 src/Auth/Process/ExpiryDate.php:191 到 SimpleSAML/Utils/HTTP.php:1011 的呼叫。檢查 redirectTrustedURL 周圍的測試框架設定,並將單元測試在沒有 InvalidArgumentException 的情況下完成定義為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
php
領域
testing
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。