Merge pull request #972 from deepak-srivastava/hr
[civicrm-core.git] / api / v3 / examples / JobCreate.php
1 <?php
2
3 /*
4
5 */
6 function job_create_example(){
7 $params = array(
8 'version' => 3,
9 'sequential' => 1,
10 'name' => 'API_Test_Job',
11 'description' => 'A long description written by hand in cursive',
12 'run_frequency' => 'Daily',
13 'api_entity' => 'ApiTestEntity',
14 'api_action' => 'apitestaction',
15 'parameters' => 'Semi-formal explanation of runtime job parameters',
16 'is_active' => 1,
17 );
18
19 $result = civicrm_api( 'job','create',$params );
20
21 return $result;
22 }
23
24 /*
25 * Function returns array of result expected from previous function
26 */
27 function job_create_expectedresult(){
28
29 $expectedResult = array(
30 'is_error' => 0,
31 'version' => 3,
32 'count' => 1,
33 'id' => 1,
34 'values' => array(
35 '0' => array(
36 'id' => '1',
37 'domain_id' => '1',
38 'run_frequency' => 'Daily',
39 'last_run' => '',
40 'name' => 'API_Test_Job',
41 'description' => 'A long description written by hand in cursive',
42 'api_entity' => 'ApiTestEntity',
43 'api_action' => 'apitestaction',
44 'parameters' => 'Semi-formal explanation of runtime job parameters',
45 'is_active' => '1',
46 ),
47 ),
48 );
49
50 return $expectedResult ;
51 }
52
53
54 /*
55 * This example has been generated from the API test suite. The test that created it is called
56 *
57 * testCreate and can be found in
58 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/JobTest.php
59 *
60 * You can see the outcome of the API tests at
61 * http://tests.dev.civicrm.org/trunk/results-api_v3
62 *
63 * To Learn about the API read
64 * http://book.civicrm.org/developer/current/techniques/api/
65 *
66 * and review the wiki at
67 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
68 *
69 * Read more about testing here
70 * http://wiki.civicrm.org/confluence/display/CRM/Testing
71 *
72 * API Standards documentation:
73 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
74 */