PHP-Auth icon indicating copy to clipboard operation
PHP-Auth copied to clipboard

PHPUnit fails due to headers already being sent

Open runnermatthew opened this issue 3 years ago • 1 comments

Testing our authentication wrapper class with PHPUnit from the command line fails with the following error:

ErrorException: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Any insight would be helpful. Thanks!

runnermatthew avatar Jan 11 '22 15:01 runnermatthew

The library is not specifically designed to work on the CLI, but instead is made for the browser. However, for tests, you should be able to make it work very easily.

Before you create the instance, as described in the README, e.g. via new \Delight\Auth\Auth($db), is there any text output before that point? That should be (re)moved.

ocram avatar Jan 12 '22 13:01 ocram