Hello, I did a system using cake that handles logins and mainly the
basic things that you get by baking (add, delete, view, edit)

I have to do som tests using simpletest php (http://simpletest.org/)

To check if a member is logged i thought that by doing an if function
such as:

                $this->browser->restart();
                $this->doLogin(USERS_ADMIN, USERS_ADMIN_PASSWORD);
                $this->browser->get(SERVER_URL.'/users/index');

if($this->browser->getCurrentCookieValue('cookies-cakephp[user_id]')
== true){

                        $this->browser->get(SERVER_URL.'/users/index');
                        $body = $this->browser->getContent();
                        $this->assertTrue(preg_match('/Users/i', $body));
                        $this->browser->clickImageById('Delete');

}

My idea was to first delete the cookies and then do a login as an
admin.

with  that if statement i wanted to check that if there is a cookie
then we could assume the user is logged but aparently this is useless
and should not be like that:

 If the if statement is false, then there is no assert in the test,
i.e., the test does not test anything. Either there should be no if
statement or the if statement should be an assert. What's odd here is
that the test appears to be able to succeed in an incorrect case (if
there is a cookie value; there should not be a cookie value)

so could I check if a user is truly loged? any idea? thankyou very
much!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to