php - PHPUnit CIUnit Issue -


when run specific test suite,

phpunit --testsuite libtests 

i expected results (passing tests). however, when run "phpunit", error claiming:

fatal error: call member function rss_feed_url() on non-object in /users/shared/jenkins/home/jobs/fanpilot_ct_3.0/workspace/tests/libs/voltampmediarssfeedtest.php on line 20 

where rss_feed_url() method of class loaded in setup().

here snippet of phpunit.xml file

<testsuites>     <testsuite name="libtests">       <directory suffix=".php">tests/libs</directory>     </testsuite> </testsuites> 

thanks in advance!

the issue was not reinitializing $this->ci proper controller. stale last test. in every setup()m need sure initialize $this-ci, this:

$this->ci = set_controller(); 

in case, have custom my_controller (applications/core/my_controller.php). therefore, can if need leverage custom controller.

$this->ci = set_controller('my_controller'); 

as side note, figured out dumping both get_class , get_parent_class within ciu_loader method, _ci_load_class, , noticed these values depending on whether ran single test or everything.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -