Using PHPUnit to test cookies and sessions, how?

Posted by The Pixel Developer on Stack Overflow See other posts from Stack Overflow or by The Pixel Developer
Published on 2010-06-16T01:21:36Z Indexed on 2010/06/16 1:22 UTC
Read the original article Hit count: 210

Filed under:
|
|
|
|

With PHPUnit it's quite easy to test raw PHP code, but what about code that heavily relies on cookies? Sessions could be a good example.

Is there a method that doesn't require me to setup $_COOKIE with data during my test? It feels like a hacky way of doing things.

© Stack Overflow or respective owner

Related posts about php

Related posts about unit-testing