Welcome Guest, Not a member yet? Register   Sign In
testing
#1

[eluser]Peyge[/eluser]
How could i test my controller function in codeigniter?
#2

[eluser]Colin Williams[/eluser]
Um, navigate to it in your browser, maybe?
#3

[eluser]Peyge[/eluser]
No, i mean unit testing our controller. i'm able to test my model but i don't know how to test my controller. I must test them as my validations are all in the controllers and this is a very sensitive application so i need to be a hundred percent sure that there is no error in my app.
#4

[eluser]bigtony[/eluser]
[url="http://ellislab.com/codeigniter/user-guide/libraries/unit_testing.html"]CodeIgniter's Unit Testing Library[/url]. Fancy that, it being in the user guide all along... ;-)
#5

[eluser]Peyge[/eluser]
Yes, they all explain how to test a model but not a controller, nor a view. That's why i'm asking it there
#6

[eluser]pistolPete[/eluser]
Did you try searching for "unit testing codeigniter controller"? There are some interesting results:

- http://ellislab.com/forums/viewthread/129253/
- http://stackoverflow.com/questions/11393...odeigniter
- http://stackoverflow.com/questions/11477...ter-part-2
- http://jensroland.com/projects/toast/
#7

[eluser]Peyge[/eluser]
yes, they all say that we can test controllers but they don't tell HOW to do it. I'm starting to think that nobody actually test his controllers or that it's impossible to test. My models are tested great but my controllers contains all the business logic and the validations so i really need to test it to be sure there is no problem and that nobody can put data that I don't want to be in my application.
#8

[eluser]Peyge[/eluser]
Anyone can help ?




Theme © iAndrew 2016 - Forum software by © MyBB