unit testing - how can I test view where authentication is required, with cakePHP and SimpleTest -


I would like to write the WebStace Seeds that require verification. Is this possible? How can I pass the certification?

I tried to write basic certification in the session but it does not work.

  $ _SESSION ['Auth'] ['user'] ['id'] = 1; $ _SESSION ['other'] ['user'] ['username'] = 'nico';    

  function login () {$ this-> - & gt; HOST_NAME "/ users / login /"); $ This- & gt; AssertText ("Login"); $ This- & gt; SetField ("data [user] [user name]", 'xxxx'); $ This- & gt; SetField ("data [user] [password]", 'xxxx'); $ This- & gt; AssertClickable ("Login to"); $ This- & gt; ClickSubmit ("Login to"); $ This- & gt; AssertNoText ("Error:"); }    

Comments