I want to write some test cases for an action in a ZF1 application. The action requires that the user be logged in, which is determined by certain data being present in the Session_Namespace.
I wrote the following setUp() function to preset the namespace with the required variables. However, it appears that the variables are not being set. The var_dump result is shown below.
How do I set up PHPUnit so that I can prepopulate the appropriate namespace with the needed variables?
public function setUp() {
$authNamespace = new Zend_Session_Namespace('auth');
$authNamespace->user_role = 'ADMIN';
$authNamespace->user_id = 1;
var_dump($authNamespace);
}
.object(Zend_Session_Namespace)#411 (1) {
["_namespace":protected]=>string(4) "auth"
}