How to use Unit Testing v2.1.4 |
[eluser]Otemu[/eluser]
Hi, The guide explains quite well how to use Unit Test so you should read though it again, however I try make things clearer for you So how do i use it? You use Unit Testing in your controller to see if a test returns an expected result, so for instance let say in your function you have a calculation to add 2 numbers 1+1 (example in guide) the expected result you would want is 2. So to achieve this follow the guide Quote:Like most other classes in CodeIgniter, the Unit Test class is initialized in your controller using the Then to display results use as follows in the guide: Quote:Generating Reports Where we put the test codes, In our main Controller or In a separate test file? You could put the tests in any controller but it would say it a much better practice to have a separate controller for tests Check out these resources below for further information and more advance features: video - Unit testing a real world Codeigniter application testing-codeigniter codeigniter_phpunit_and_netbeans unit-testing-for-codeigniter-phpunit-and-ciunit codeigniter-unit-testing |
Messages In This Thread |
How to use Unit Testing v2.1.4 - by El Forum - 11-06-2013, 08:10 PM
How to use Unit Testing v2.1.4 - by El Forum - 11-07-2013, 10:14 AM
How to use Unit Testing v2.1.4 - by El Forum - 11-07-2013, 12:49 PM
How to use Unit Testing v2.1.4 - by El Forum - 11-08-2013, 04:16 AM
|