I found a test that fails when run from a browser if you are logged in. I need to make sure the session is cleared out before running this test. Is there an easy way to clear the CakePHP session from within a test?
I tried calling Session::Destroy(); but the test cannot seem to get visibility of Session.
Maybe I am trying to import Session incorrectly?
I am using: App::import(‘Core’, ‘Session’);
I believe gustavotkg is correct. We should be using mock objects. Unfortunately, it will not be completely straight forward to do this the way the code was set up. I will have to go back and rework some things. For a temporary fix this is what I did: