Title: RE: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Thread: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Forum: Need Help?
User: lmajano For consideration:
There are some possible solutions that come to my head
1) The factory is separate and looks for the controller in app scope.
Remove the throw and create a new property : cbController that is set from
application scope if it exists. Then if calls to the factory are made and the
controller is non existent in the property it will just fail, which is ok. Now,
if in unit testing mode, the base test will check if the factory is in the IoC
container. If it is, then it will inject the unit testing controller into it.
2) Create a new factory called testColdBoxFactory. Which can be based of a unit
Can you guys brainstorm a solution here. I am leaning
towards solution 1.