Tester Module - Testing Controllers?

edited March 2014 in Modules
I have the tester module working fine but how do I go about testing my controllers. I have created a class that uses an instance of CI to load models and views so that I can test them. But how do I load a controller to test the methods on that.

Comments

  • edited 4:18AM
    The tester module doesn't really allow you to test controllers. You can test the final output of the controllers by testing for elements on the page using the pq function (as you've probably read in the documentation http://docs.getfuelcms.com/modules/tester).
  • edited 4:18AM
    Thanks... I wanted to create the tests to check the logic in the controller methods. I was going to use selenium to test the output but I suppose I could do both and use PQ to run through tests and selenium to do the end to end stuff.
  • edited 4:18AM
    How do I set session variables using the page load? I have tried loading the session library and setting them the normal way but when I do page load it does not recognise the session variable I have tried to set.
  • edited 4:18AM
    The load_page method should set any cookies and write them to the cache folder (so make sure that is writable if it isn't already). There is a test that comes with FUEL in the fuel/modules/fuel/tests/Fuel_login_test.php that logs in to the FUEL admin which uses the Session library (you may need to disable all other advanced modules and simple modules for it to work without any database errors though).
Sign In or Register to comment.