-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz_functions.php
52 lines (43 loc) · 1.38 KB
/
quiz_functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
declare(strict_types=1);
require_once 'vendor/autoload.php';
function call_create_user(): object
{
PlumVoice\Api::setup('production');
$parameters = [
'email' => '[email protected]',
'password' => 'password',
'confirm_password' => 'password',
'first_name' => 'test',
'last_name' => 'user',
'street_number' => 123,
'street_name' => 'fake street',
'city' => 'boston',
'state' => 'ma',
];
return PlumVoice\Api::getInstance()->createUser($parameters);
}
function call_get_user(): object
{
PlumVoice\Api::setup('development');
return PlumVoice\Api::getInstance()->getUser(23234);
}
function call_delete_user(): object
{
PlumVoice\Api::setup('production');
return PlumVoice\Api::getInstance()->deleteUser(23234);
}
function call_update_user(): object
{
PlumVoice\Api::setup('production');
// "...write a function that calls the production update user API
// method that updates the user’s address information and password..."
// The author assumes this requirement corresponds to email address,
// not physical, as it is the closest parameter string match.
$parameters = [
'email' => '[email protected]',
'password' => 'password2',
'confirm_password' => 'password2',
];
return PlumVoice\Api::getInstance()->updateUser(23234, $parameters);
}