-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lib: Add dbidAsParam flag, isolate Query settings
- API_GetAppDTMInfo needed to be executed against /db/main with the dbid passed in as a query string parameter. To achieve this, a new flag in the settings.flags object has been created: dbidAsParam (defaults to false). When dbidAsParam is true, any passed in dbid option will be sent via the query string or xml packet instead of the URL path. - Isolated each QuickBaseQuery settings so that an overwritten setting for a specific query does not affect other queries. - Added parsing of non-xml responses - Added API_GetAppDTMInfo response parsing - Added API_GetRoleInfo response parsing - Added API_GrantedDBs response parsing - Added API_UserRoles response parsing - Added appid testing env variable - Added test for API_AddReplaceDBPage - Added test for API_CreateDatabase (pending) - Added test for API_CreateTable (pending) - Added test for API_FindDBByName - Added test for API_GenAddRecordForm - Added test for API_GenResultsTable - Added test for API_GetAncestorInfo - Added test for API_GetAppDTMInfo - Added test for API_GetDBInfo - Added test for API_GetDBPage - Added test for API_GetDBVar - Added test for API_GetNumRecords - Added test for API_GetRoleInfo - Added test for API_GrantedDBs - Added test for API_ImportFromCSV - Added test for API_PurgeRecords - Added test for API_SetDBVar - Added test for API_UserRoles
- Loading branch information
Showing
21 changed files
with
835 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* Copyright 2015 Tristian Flanagan | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
$expected = array( | ||
'action' => 'API_AddReplaceDBPage.js', | ||
'errcode' => 0, | ||
'errtext' => 'No error', | ||
'pageID' => 0 | ||
); | ||
|
||
$actual = $qb->api('API_AddReplaceDBPage', array( | ||
'dbid' => getenv('appid'), | ||
'pagename' => 'testpage.html', | ||
'pagetype' => 1, | ||
'pagebody' => '<html></html>' | ||
)); | ||
|
||
if(!objStrctMatch($actual, $expected)){ | ||
throw new Exception('Mismatched API_AddReplaceDBPage Data Structure'); | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/* Copyright 2015 Tristian Flanagan | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
echo 'test skipped... '; | ||
|
||
return; | ||
|
||
$expected = array( | ||
'action' => 'API_CreateDatabase', | ||
'errcode' => 0, | ||
'errtext' => 'No error', | ||
'dbid' => '', | ||
'appdbid' => '', | ||
'apptoken' => '' | ||
); | ||
|
||
$actual = $qb->api('API_CreateDatabase', array( | ||
'dbname' => 'Test DB', | ||
'dbdesc' => 'Testing DB from Node-QuickBase Tests', | ||
'createapptoken' => true | ||
)); | ||
|
||
if(!objStrctMatch($actual, $expected)){ | ||
throw new Exception('Mismatched API_CreateDatabase Data Structure'); | ||
} | ||
|
||
$expected = array( | ||
'action' => 'API_DeleteDatabase', | ||
'errcode' => 0, | ||
'errtext' => 'No error' | ||
); | ||
|
||
$actual = $qb->api('API_DeleteDatabase', array( | ||
'dbid' => $actual['appdbid'] | ||
)); | ||
|
||
if(!objStrctMatch($actual, $expected)){ | ||
throw new Exception('Mismatched API_DeleteDatabase Data Structure'); | ||
} | ||
|
||
?> |
Oops, something went wrong.