update test generated examples
[civicrm-core.git] / api / v3 / examples / BatchCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function batch_create_example(){
edb0d67a 7$params = array(
6a488035
TO
8 'name' => 'New_Batch_03',
9 'title' => 'New Batch 03',
10 'description' => 'This is description for New Batch 03',
11 'total' => '300.33',
12 'item_count' => 3,
13 'status_id' => 1,
14 'version' => 3,
edb0d67a 15 'debug' => 0,
6a488035
TO
16);
17
18 $result = civicrm_api( 'batch','create',$params );
19
20 return $result;
21}
22
23/*
24 * Function returns array of result expected from previous function
25 */
26function batch_create_expectedresult(){
27
edb0d67a 28 $expectedResult = array(
6a488035
TO
29 'is_error' => 0,
30 'version' => 3,
31 'count' => 1,
edb0d67a 32 'id' => 1,
33 'values' => array(
34 '1' => array(
35 'id' => '1',
6a488035
TO
36 'name' => 'New_Batch_03',
37 'title' => 'New Batch 03',
38 'description' => 'This is description for New Batch 03',
39 'created_id' => '',
edb0d67a 40 'created_date' => '20120130621222105',
6a488035
TO
41 'modified_id' => '',
42 'modified_date' => '2012-11-14 16:02:35',
43 'saved_search_id' => '',
44 'status_id' => '1',
45 'type_id' => '',
46 'mode_id' => '',
47 'total' => '300.33',
48 'item_count' => '3',
49 'payment_instrument_id' => '',
50 'exported_date' => '',
51 ),
52 ),
53);
54
55 return $expectedResult ;
56}
57
58
59/*
60* This example has been generated from the API test suite. The test that created it is called
61*
62* testCreate and can be found in
63* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/BatchTest.php
64*
65* You can see the outcome of the API tests at
66* http://tests.dev.civicrm.org/trunk/results-api_v3
67*
68* To Learn about the API read
69* http://book.civicrm.org/developer/current/techniques/api/
70*
71* and review the wiki at
72* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
73*
74* Read more about testing here
75* http://wiki.civicrm.org/confluence/display/CRM/Testing
76*
77* API Standards documentation:
78* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
79*/