You need to sign in to do that
Don't have an account?
Richard Houston 20
Custom controller extension test class
Hi,
I have a custom controller for a visualforce page that contains a flow. I'm not sure where to even start to write a test class for it. Any help would be most appreciated!
What I have is a custom object, Project Information, that has a record created through the flow. The exit page is then set to the newly created record's page. ProjInfoID is a variable within the flow.
I have a custom controller for a visualforce page that contains a flow. I'm not sure where to even start to write a test class for it. Any help would be most appreciated!
What I have is a custom object, Project Information, that has a record created through the flow. The exit page is then set to the newly created record's page. ProjInfoID is a variable within the flow.
public class ProjInfoFlowController { public Flow.Interview.CreateProjInfo myFlow { get; set; } public String getmyID() { if (myFlow==null) return ''; else return myFlow.ProjInfoID; } public PageReference getOID(){ PageReference p = new PageReference('/' + getmyID()); p.setRedirect(true); return p; } }
You'll also want to create a test method to test the scenario where the Flow is populated. However, you'll need to post your VF page b/c from your controller it's not possible to tell what type of parameters the Flow requires.
Hope that helps,
Clint
All Answers
You'll also want to create a test method to test the scenario where the Flow is populated. However, you'll need to post your VF page b/c from your controller it's not possible to tell what type of parameters the Flow requires.
Hope that helps,
Clint
Thanks for the quick reply and help! I'll give this a try now.
Here's the visualforce page's code.