Unit Testing with items that need to send headers

后端 未结 11 1939
春和景丽
春和景丽 2020-12-03 01:01

I\'m currently working with PHPUnit to try and develop tests alongside what I\'m writing, however, I\'m currently working on writing the Session Manager, and am having issue

11条回答
  •  一个人的身影
    2020-12-03 01:28

    It seems that you need to inject the session so that you can test your code. The best option I have used is Aura.Auth for the authentication process and using NullSession and NullSegment for testing.

    Aura testing with null sessions

    The Aura framework is beautifully written and you can use Aura.Auth on its own without any other Aura framework dependencies.

提交回复
热议问题