Issue #8 resolved

Custom Output Library overrides fooOutput library

mbiang
created an issue

I have a custom output library defined in my application/libraries folder. when I attempt to run tests from the command line, I receive the following message:

..........PHP Fatal error: Call to undefined method edudirect_Output::pop_output() in ~/Sites/EDUDIRECT/trunk/system/application/tests/CIUnit.php on line 222

where edudirect_Ouput is the name of my applications custom output library.

It looks like for some reason CIUnit is loading my custom output library rather than fooOutput.

Comments (3)

  1. rafsoaken repo owner

    Hi,

    you have to extend the fooOutput class in your MY_Output class like so:

    <?php
    
    #file MY_Oputput.php
    
    class MY_Output extends fooOutput {
    
        function __construct()
        {
            parent::fooOutput();
        }
    
        function myfunction()
        {
            return True;
        }
    
    }
    
    

    and then you can eg. test if the function of your output class is callable, like so

        function testMyOutputClass()
        {
            $this->assertTrue($this->CI->output->myfunction());
        }
    
    

    I tested this with CodeIgniter 1.7.2 and had no issues. Please let me know if that solves your problem. cheers rafsoaken

  2. Log in to comment