You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

CPM error in test harness

Received Response
17
Views
5
Comments
edited Jun 8, 2022 12:02PM in General Technical Discussions 5 comments

Content

Hi All,

I have written a cpm script for incident create and update.While testing it, in setup function of test harness i am fetching an existing incident id. But it is giving the error 'Invalid ID:No such incident'. 
Is this the proper way to test or do need to create test object in the setup function?

Thanks

Puneet

 

Code Snippet

             public static function setup()
{
 	$incidentOne = RNCPHP\Incident::fetch(218);
	$incidentOne->save();
	self::$incidentOneId = $incidentOne->ID;
	 
	return; 
} 
        

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!