Welcome Guest, Not a member yet? Register   Sign In
Bootstrap phpunit with index.php results in improper setting of global Codeigniter variables.
#1

[eluser]michaelbenbender[/eluser]
I'm trying to use phpunit with CI. It seems that when I use the phpunit bootstrap command my global variables that are set in Codeigniter.php like $BM, $CFG etc... are not set as globals. I'm assuming this is because of the way the bootstrapper works, but I was wondering if anyone had any experience with phpunit or bootstrapping CI to initialize outside of the browser.

Alternatively, any info on where Codeigniter understands or functions differently by running a controller from the command line vs. browser? Does it run differently. By the way, running php index.php controller method sets globals properly, so my first problem has to be related to phpunit.

I just want to be able to get a CI instance in my phpunit setup functions.
#2

[eluser]Eric Barnes[/eluser]
My best advice is to check out the "unit_tests" branch in reactor. Although still in development it should give you something to build off of.




Theme © iAndrew 2016 - Forum software by © MyBB