_apiversion = 3; $this->params = array( 'name' => 'test status', 'label' => 'I am a test', 'class' => 'Positive', 'is_reserved' => 0, 'is_active' => 1, 'is_counted' => 1, 'visibility_id' => 1, 'weight' => 10, ); parent::setUp(); $this->useTransaction(TRUE); } public function testCreateParticipantStatusType() { $result = $this->callAPIAndDocument('participant_status_type', 'create', $this->params, __FUNCTION__, __FILE__); $this->assertEquals(1, $result['count']); $this->assertNotNull($result['values'][$result['id']]['id']); } public function testGetParticipantStatusType() { $result = $this->callAPIAndDocument('participant_status_type', 'create', $this->params, __FUNCTION__, __FILE__); $this->assertEquals(1, $result['count']); $result = $this->callAPIAndDocument('participant_status_type', 'get', $this->params, __FUNCTION__, __FILE__); $this->assertEquals(1, $result['count']); $this->assertNotNull($result['values'][$result['id']]['id']); $this->id = $result['id']; } public function testDeleteParticipantStatusType() { $ParticipantStatusType = $this->callAPISuccess('ParticipantStatusType', 'Create', $this->params); $entity = $this->callAPISuccess('participant_status_type', 'get', array()); $result = $this->callAPIAndDocument('participant_status_type', 'delete', array('id' => $ParticipantStatusType['id']), __FUNCTION__, __FILE__); $getCheck = $this->callAPISuccess('ParticipantStatusType', 'GET', array('id' => $ParticipantStatusType['id'])); $checkDeleted = $this->callAPISuccess('ParticipantStatusType', 'Get', array()); $this->assertEquals($entity['count'] - 1, $checkDeleted['count']); } }