I’ve hit a little bit of a stumbling block and can’t seem to find a way to test model constraints with the cbvalidation module. Does some have an example of a unit test where they can call validateModel() and receive back everything that the ValidationManager returns?
I’ve tried something like:
validator = new cborm.modules.cbvalidation.models.ValidationManager();
But when I call validator.validateModel( model ) it seems to fail when it hits the resourceService saying it can’t be found.
I’ve also tried having wirebox get access and it can never find the cbvalidation instance by doing:
application.wirebox = new coldbox.system.ioc.Injector();
validator = application.wirebox.getInstance(“ValidationManager@cbvalidation”);
But it can never find that module for some reason.
I’ve even tried using mockWireBox to get the instance and it tells me it can’t find it as well.
Does anyone have an example of doing this they could share so I can see what piece of this I’m missing?