canmove, Confirmed users, Bureaucrats and Sysops emeriti
1,043
edits
No edit summary |
(added basic controller test example) |
||
| Line 6: | Line 6: | ||
===Controller Tests=== | ===Controller Tests=== | ||
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=== | ||