78
edits
mNo edit summary |
|||
| Line 1: | Line 1: | ||
[[Update:Remora|« Back to Update:Remora]] | [[Update:Remora|« Back to Update:Remora]] | ||
= Test Framework = | |||
We use the [http://simpletest.org/ SimpleTest php testing framework] and some helper files for [http://svn.mozilla.org/addons/trunk/site/app/tests/test_helper_unit.php unit tests] dug up from the grave of the internets. | |||
= Test Structure = | = Test Structure = | ||
== Test locations == | == Test locations == | ||
| Line 48: | Line 51: | ||
class DevelopersControllerTest extends UnitTestCase { | class DevelopersControllerTest extends UnitTestCase { | ||
/** | |||
* Setup the Developers Controller | |||
*/ | |||
function testLoad() { | |||
$this->helper = new UnitTestHelper(); | |||
$this->controller = $this->helper->getController('Developers', $this); | |||
//$this->helper->mockModels($this->controller, $this); | |||
$this->helper->mockComponents($this->controller, $this); | |||
} | |||
/** | |||
* Tests something | |||
*/ | |||
function testSomething() { | |||
$this->assertTrue($this->helper->callControllerAction($this->controller, 'add', $this)); | |||
} | |||
} | } | ||
?> | ?> | ||
| Line 75: | Line 78: | ||
<?php | <?php | ||
class AmoTest extends UnitTestCase { | class AmoTest extends UnitTestCase { | ||
//Setup the Amo Component | |||
function setUp() { | |||
loadComponent('Amo'); | |||
$this->Amo =& new AmoComponent(); | |||
} | |||
//Make sure the addontypes is an array | |||
function testAddonTypes() { | |||
$this->assertIsA($this->Amo->addonTypes, 'array'); | |||
} | |||
} | } | ||
?> | ?> | ||
edits