php - Why is CIUnit needed in order to use PHPUnit with CodeIgniter? -
we've decided use phpunit (with jenkins) in our next project. we're considering different php frameworks, 1 of codeigniter. see a lot of people use my ciunit "bridge" phpunit , codeigniter. there little no explanation in online documentation.
why needed?
other frameworks don't seem need "cool bridge" this.
reasons:
- codeigniter's components tightly coupled. need big basic parts running (the loader, router, cfg object) before can use other pieces.
- codeigniter not designed run cli. has great deal of bootstrapping code in index.php front-controller, , assumes web server environment.
you not absolutely require ciunit unit-test ci. have something. in case, wrote alternative front controller index.php loads minimum necessary ci superobject. require_once
@ top of test files, , $this->ci =& get_instance()
in setup()
methods. if being absolutely pure unit-tester, however, should destroying , re-creating ci object after every test in case state got trapped in it. i'm not sure if ciunit you.
Comments
Post a Comment