Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | ||
5 | */ | |
6 | function relationship_type_create_example(){ | |
7 | $params = array( | |
8 | 'name_a_b' => 'Relation 1 for relationship type create', | |
9 | 'name_b_a' => 'Relation 2 for relationship type create', | |
10 | 'contact_type_a' => 'Individual', | |
11 | 'contact_type_b' => 'Organization', | |
12 | 'is_reserved' => 1, | |
13 | 'is_active' => 1, | |
14 | 'version' => 3, | |
15 | 'sequential' => 1, | |
16 | ); | |
17 | ||
18 | $result = civicrm_api( 'relationship_type','create',$params ); | |
19 | ||
20 | return $result; | |
21 | } | |
22 | ||
23 | /* | |
24 | * Function returns array of result expected from previous function | |
25 | */ | |
26 | function relationship_type_create_expectedresult(){ | |
27 | ||
28 | $expectedResult = array( | |
29 | 'is_error' => 0, | |
30 | 'version' => 3, | |
31 | 'count' => 1, | |
32 | 'id' => 1, | |
33 | 'values' => array( | |
34 | '0' => array( | |
35 | 'id' => '1', | |
36 | 'name_a_b' => 'Relation 1 for relationship type create', | |
37 | 'label_a_b' => 'Relation 1 for relationship type create', | |
38 | 'name_b_a' => 'Relation 2 for relationship type create', | |
39 | 'label_b_a' => 'Relation 2 for relationship type create', | |
40 | 'description' => '', | |
41 | 'contact_type_a' => 'Individual', | |
42 | 'contact_type_b' => 'Organization', | |
43 | 'contact_sub_type_a' => '', | |
44 | 'contact_sub_type_b' => '', | |
45 | 'is_reserved' => '1', | |
46 | 'is_active' => '1', | |
47 | ), | |
48 | ), | |
49 | ); | |
50 | ||
51 | return $expectedResult ; | |
52 | } | |
53 | ||
54 | ||
55 | /* | |
56 | * This example has been generated from the API test suite. The test that created it is called | |
57 | * | |
58 | * testRelationshipTypeCreate and can be found in | |
59 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/RelationshipTypeTest.php | |
60 | * | |
61 | * You can see the outcome of the API tests at | |
62 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
63 | * | |
64 | * To Learn about the API read | |
65 | * http://book.civicrm.org/developer/current/techniques/api/ | |
66 | * | |
67 | * and review the wiki at | |
68 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
69 | * | |
70 | * Read more about testing here | |
71 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
72 | * | |
73 | * API Standards documentation: | |
74 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
75 | */ |