Answer the question
In order to leave comments, you need to log in
Yii::app()->user->isGuest when testing with phpunit
In the tests, Yii::app()->user->login, Yii::app()->user->logout are executed several times in order to test under different users.
But after the second login, the value of Yii::app()->user->isGuest does not change (constantly false)
. if you run the following code:
echo (int)Yii::app()->user->isGuest;
Yii::app()->user->login;
echo (int)Yii::app()->user->isGuest;
Yii::app()->user->logout
echo (int)Yii::app()->user->isGuest;
... итд
Answer the question
In order to leave comments, you need to log in
> the user component is inherited from EMongoDocument.
This is somewhat strange.
Then see how you have implemented the getIsGuest, login and logout functions in this component
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question