For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Does anyone have a sample of successfully setting up a test harness to check for the change of a field value when the action is an update?
I have tried building a test harness and updating the field I am looking at (contacts.ma_opt_in), but the $object->prev object is always empty.
The fetchObject() method should return the object or objects in the precise states that are to be tested --- they are passed as-is into the apply() method.
So, if I want to test the prev, I just add the prev to the object and set the prev values to what I want to test, e.g. for an existing $org (created by either the setup() or fetchObject() method, I might do something like:
$org->prev = new RNCPHP\Organization; $org->prev->Name = "TheFormerName"; ...
First off, thanks again @mark. I was able to create a 10 or 12 test cases in my CPM, and I was able to get them all working.
However, once I moved on to my next CPM, I ran into another issue that I am hoping someone can shed some light on.
I need to see if there is a new attachment in this CPM. My plan was to get the list of file attachments from both the current and previous object and compare the FileNames and their respective UpdateTime fields. Unfortunately UpdatedTime is a read-only field on the FileAttachmentCommon object, so I cannot set dummy UpdateTimes in the TestHarness and then execute different test cases. Again, this would only be an issue in the test harness, but I'm a big fan of thoroughly testing my code...
Any ideas on how I could get around that?
Hi Mark,
I need to send a mail to contact when the status of Contract(custom object) is expired. While testing in Process designer it works fine and receiving mail for both update and create test cases. But when i try to create a new contract with status expired it doesn't triggers the mail. Please help me to solve this. I have deployed the event handler and also mapped it to contracts object for update/Create. Is there any other mapping to be done?receiving
The fetchObject() method should return the object or objects in the precise states that are to be tested --- they are passed as-is into the apply() method.
So, if I want to test the prev, I just add the prev to the object and set the prev values to what I want to test, e.g. for an existing $org (created by either the setup() or fetchObject() method, I might do something like: