Welcome Guest, Not a member yet? Register   Sign In
Is there a way to use ci helpers, libraries, etc. without mvc
#1

[eluser]MyDarkPassenger[/eluser]
First off I'm a big fan of the MVC layout, however I'd like to be able to run models independent of MVC so that I could use phpunit against it. Unfortunately, I can't use it when MVC is being used. I have to use SimpleTest which is nice, however I can't autogenerate tests and such in Netbeans with it. I know with the Zend Framework you can use the libraries without MVC so I'm wondering if there's a way to do this with CI? If not has anyone gotten ci to work with phpunit.
#2

[eluser]vitoco[/eluser]
As far as i know, only Models are dependent from the CI MVC framework, cause it extends from CI_Model, but libraries and helpers are regular PHP files with the exception that inside a the code use a CI resource like
$CI = &get;_instance();

I think that i saw an PHP unit example in the wiki
#3

[eluser]MyDarkPassenger[/eluser]
Helpful, then I might be able to create the models as regular classes for unit tests and extend the model when in MVC. I was only worried about the libraries and helpers. The unit library that CI offers is very limited. It's good for quick tests but it's nothing special. I primarily want to use phpunit instead because netbeans can auto generate the test structure and run the tests hitting shift + f6 (I believe). It's very fast plus it's a very good unit tester.
#4

[eluser]vitoco[/eluser]
BTW , only now i've read your nick, Dexter fan ??
#5

[eluser]MyDarkPassenger[/eluser]
Yeah, I picked it after I read the first book. The show barely ever mentions it.




Theme © iAndrew 2016 - Forum software by © MyBB