Update:Remora Testing: Difference between revisions

m
no edit summary
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
    * Setup the Developers Controller
*/
    */
function testLoad() {
    function testLoad() {
$this->helper = new UnitTestHelper();
        $this->helper = new UnitTestHelper();
$this->controller = $this->helper->getController('Developers', $this);
        $this->controller = $this->helper->getController('Developers', $this);
//$this->helper->mockModels($this->controller, $this);
        //$this->helper->mockModels($this->controller, $this);
$this->helper->mockComponents($this->controller, $this);
        $this->helper->mockComponents($this->controller, $this);
}
    }


/**
    /**
* Tests something
    * Tests something
*/
    */
function testSomething() {
    function testSomething() {
$this->assertTrue($this->helper->callControllerAction($this->controller, 'add', $this));
        $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
    //Setup the Amo Component
function setUp() {
    function setUp() {
loadComponent('Amo');
        loadComponent('Amo');
$this->Amo =& new AmoComponent();
        $this->Amo =& new AmoComponent();
}
    }


//Make sure the addontypes is an array
    //Make sure the addontypes is an array
function testAddonTypes() {
    function testAddonTypes() {
$this->assertIsA($this->Amo->addonTypes, 'array');
        $this->assertIsA($this->Amo->addonTypes, 'array');
}
    }
}
}
?>
?>
78

edits