I have a coldfusion application which uses Coldspring and FW1 frameworks. I have a cfc User.cfc
having many properties like name, email etc. These properties are added using cfproperty
. When I am writing test cases using mxunit for a function in User.cfc, I got an exception as below
services.domain.user: The value returned from the setName function is not of type services.domain.user. If the component name is specified as a return type, it is possible that either a definition file for the component cannot be found or is not accessible.
I got this error when I try to mock the setter function using
<cfset local.user.$("setName") />
So my question is whether cfc setter methods return the same object? I think it should be void
Your setter should be returning nothing. Setters shouldn't return anything, that's why they're setters and not getters. It looks like the returntype is set to "this", the object. Only the init function should return 'this'. Check your returntype. And you're using ColdSpring AND FW/1? Thats weird.