Welcome Guest, Not a member yet? Register   Sign In
codeigniter + simple test???
#1

[eluser]gulan[/eluser]
Hi all...

Somebody please tell me how to do simpletest (unit test) for php files which is in codeigniter frame work????


Thanks
gulan
#2

[eluser]geshan[/eluser]
I also want to know about it.
#3

[eluser]Mark Skilbeck[/eluser]
Let met google that for you
#4

[eluser]gon[/eluser]
This works if you have simpletest in your php.ini include_path.

Code:
<?php

require_once("unit_tester.php");
require_once('reporter.php');

class Test extends Controller {

    function Test()
    {    
        parent::Controller();
                    
        $this->test =& new TestSuite('AllTests');
        
        $this->test->addTestFile(APPPATH.'test/testXMLBaseParser.php');
        $this->test->addTestFile(APPPATH.'test/testReslib.php');            
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyMethods.php');
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyFixture1.php');        
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyFixture2.php');
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyFixture3.php');
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyFixture4.php');
        $this->test->addTestFile(APPPATH.'test/testPurchaseCancellationPolicyFixture5.php');
        
          
       // ... lots of test classes
        
        
    }
    
    function index(){    
        $this->test->run(new HtmlReporter());    
            
    }
    
    function text() {        
        $this->test->run(new TextReporter());
    }
    function xml() {
        $this->test->run(new XmlReporter());
    }    
    
}
?>




Theme © iAndrew 2016 - Forum software by © MyBB