update test generated examples
[civicrm-core.git] / api / v3 / examples / WebsiteCreate.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function website_create_example(){
7$params = array(
8 'version' => 3,
9 'contact_id' => 3,
10 'url' => 'website.com',
11 'website_type_id' => 1,
12);
13
14 $result = civicrm_api( 'website','create',$params );
15
16 return $result;
17}
18
19/*
20 * Function returns array of result expected from previous function
21 */
22function website_create_expectedresult(){
23
24 $expectedResult = array(
25 'is_error' => 0,
26 'version' => 3,
27 'count' => 1,
28 'id' => 1,
29 'values' => array(
30 '1' => array(
31 'id' => '1',
32 'contact_id' => '3',
33 'url' => 'website.com',
34 'website_type_id' => '1',
35 ),
36 ),
37);
38
39 return $expectedResult ;
40}
41
42
43/*
44* This example has been generated from the API test suite. The test that created it is called
45*
46* testCreateWebsite and can be found in
47* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/WebsiteTest.php
48*
49* You can see the outcome of the API tests at
50* http://tests.dev.civicrm.org/trunk/results-api_v3
51*
52* To Learn about the API read
53* http://book.civicrm.org/developer/current/techniques/api/
54*
55* and review the wiki at
56* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
57*
58* Read more about testing here
59* http://wiki.civicrm.org/confluence/display/CRM/Testing
60*
61* API Standards documentation:
62* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
63*/