Skip to content

test module with redirectTrustedURL #3

@jmoral

Description

@jmoral

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions