-
Notifications
You must be signed in to change notification settings - Fork 23
/
DescribeActions.php
48 lines (42 loc) · 967 Bytes
/
DescribeActions.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
<?php
/***********************************************
DAVE PHP API
https://github.com/evantahler/PHP-DAVE-API
Evan Tahler | 2011
I check an API Action
***********************************************/
require("../spec_helper.php");
$T = new DaveTest("Output Tests");
// I should return an array of actions
$PostArray = array(
"OutputType" => "PHP",
"Action" => "DescribeActions",
"LimitLockPass" => $CONFIG['CorrectLimitLockPass']
);
var_dump($TestURL);
$APIRequest = new APIRequest($TestURL, $PostArray);
$APIDATA = $APIRequest->DoRequest();
$ExpectedActions = array(
"DescribeActions",
"DescribeTables",
"ObjectTest",
"GeoCode",
"CacheTest",
"UserAdd",
"UserView",
"UserEdit",
"UserEdit",
"LogIn"
);
$T->assert(">",count($APIDATA["Actions"]),0);
$Actions = array();
foreach($APIDATA["Actions"] as $Action)
{
$Actions[] = $Action["Name"];
}
foreach($ExpectedActions as $Action)
{
$T->assert("in_array",$Action,$Actions);
}
$T->end();
?>