Update:Remora Testing: Difference between revisions

added basic controller test example
No edit summary
(added basic controller test example)
Line 6: Line 6:


===Controller Tests===
===Controller Tests===
Controller tests must be located in the models directory. Example will be posted here eventually.
Controllers can be tested as displayed in the following example. Note that these must be saved in the models directory.
 
File path: /var/www/html/fligtar/app/tests/app/cases/models/addon.test.php
 
Web path: http://142.204.204.140.147:8080/fligtar/tests/cases?case=models%2Faddon.test.php&app=true
<pre>
<?php
class AddonsControllerTest extends UnitTestCase {
 
        /**
        * Setup the Addons Controller
        */
        function setUp() {
                $this->model =& new Addon();
        }
 
        /**
        * Make sure there are no PHP errors
        */
        function testNoErrors() {
                $this->assertNoErrors();
        }
}
</pre>


===Component Tests===
===Component Tests===
canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,043

edits