Commit b63d7acf6b6889bd0d89a29b70224d1b81332ff3
1 parent
b2d61b78
Merged in from DEV trunk...
KTS-2115 "create unit tests for ktapi" Fixed. Added a test for using existing sessions. Reviewed By: Kevin Fourie KTS-2115 "create unit tests for ktapi" Fixed. KT_DIR was mistakenly used when it is only part of dmsDefaults. Reviewed By: Kevin Fourie KTS-2115 "create unit tests for ktapi" Updated. added licensing. Reviewed By: Kevin Fourie KTS-2115 "create unit tests for ktapi" Fixed. Temporarily commented ktapi tests Reviewed By: Kevin Fourie KTS-2115 "create unit tests for ktapi" Fixed. Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6837 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
9 changed files
with
184 additions
and
17 deletions
ktapi/KTAPIConstants.inc.php
| 1 | 1 | <? |
| 2 | - | |
| 3 | 2 | /** |
| 4 | - * | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | 5 | * The contents of this file are subject to the KnowledgeTree Public |
| 6 | 6 | * License Version 1.1.2 ("License"); You may not use this file except in |
| 7 | 7 | * compliance with the License. You may obtain a copy of the License at |
| ... | ... | @@ -29,10 +29,6 @@ |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | -require_once('../config/dmsDefaults.php'); | |
| 33 | -require_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); | |
| 34 | -require_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); | |
| 35 | - | |
| 36 | 32 | // Generic error messages used in the API. There may be some others specific to functionality |
| 37 | 33 | // directly in the code. |
| 38 | 34 | // TODO: Check that they are all relevant. | ... | ... |
ktapi/KTAPIDocument.inc.php
| 1 | 1 | <? |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 31 | + | |
| 2 | 32 | class KTAPI_Document extends KTAPI_FolderItem |
| 3 | 33 | { |
| 4 | 34 | /** | ... | ... |
ktapi/KTAPIFolder.inc.php
| 1 | 1 | <? |
| 2 | - | |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 3 | 31 | |
| 4 | 32 | class KTAPI_Folder extends KTAPI_FolderItem |
| 5 | 33 | { | ... | ... |
ktapi/KTAPISession.inc.php
| 1 | 1 | <? |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 2 | 31 | |
| 3 | 32 | class KTAPI_Session |
| 4 | 33 | { | ... | ... |
ktapi/ktapi.inc.php
| 1 | 1 | <? |
| 2 | 2 | /** |
| 3 | - * | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 4 | 5 | * Implements a cleaner wrapper API for KnowledgeTree. |
| 5 | 6 | * |
| 6 | 7 | * The contents of this file are subject to the KnowledgeTree Public |
| ... | ... | @@ -31,7 +32,7 @@ |
| 31 | 32 | */ |
| 32 | 33 | |
| 33 | 34 | session_start(); |
| 34 | -require_once(KT_DIR . '/config/dmsDefaults.php'); | |
| 35 | +require_once(realpath(dirname(__FILE__) . '/../config/dmsDefaults.php')); | |
| 35 | 36 | require_once(KT_LIB_DIR . '/filelike/fsfilelike.inc.php'); |
| 36 | 37 | require_once(KT_LIB_DIR . '/foldermanagement/folderutil.inc.php'); |
| 37 | 38 | ... | ... |
tests/api/authentication.php
| 1 | 1 | <? |
| 2 | - | |
| 3 | - | |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 4 | 31 | |
| 5 | 32 | require_once(dirname(__FILE__) . '/../test.php'); |
| 6 | 33 | require_once(KT_DIR . '/ktapi/ktapi.inc.php'); | ... | ... |
tests/api/document.php
| 1 | 1 | <? |
| 2 | - | |
| 3 | - | |
| 4 | - | |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 5 | 31 | require_once(dirname(__FILE__) . '/../test.php'); |
| 6 | 32 | require_once(KT_DIR . '/ktapi/ktapi.inc.php'); |
| 7 | 33 | ... | ... |
tests/api/folder.php
| 1 | 1 | <? |
| 2 | +/** | |
| 3 | + * $Id$ | |
| 4 | + * | |
| 5 | + * The contents of this file are subject to the KnowledgeTree Public | |
| 6 | + * License Version 1.1.2 ("License"); You may not use this file except in | |
| 7 | + * compliance with the License. You may obtain a copy of the License at | |
| 8 | + * http://www.knowledgetree.com/KPL | |
| 9 | + * | |
| 10 | + * Software distributed under the License is distributed on an "AS IS" | |
| 11 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. | |
| 12 | + * See the License for the specific language governing rights and | |
| 13 | + * limitations under the License. | |
| 14 | + * | |
| 15 | + * All copies of the Covered Code must include on each user interface screen: | |
| 16 | + * (i) the "Powered by KnowledgeTree" logo and | |
| 17 | + * (ii) the KnowledgeTree copyright notice | |
| 18 | + * in the same form as they appear in the distribution. See the License for | |
| 19 | + * requirements. | |
| 20 | + * | |
| 21 | + * The Original Code is: KnowledgeTree Open Source | |
| 22 | + * | |
| 23 | + * The Initial Developer of the Original Code is The Jam Warehouse Software | |
| 24 | + * (Pty) Ltd, trading as KnowledgeTree. | |
| 25 | + * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright | |
| 26 | + * (C) 2007 The Jam Warehouse Software (Pty) Ltd; | |
| 27 | + * All Rights Reserved. | |
| 28 | + * Contributor( s): ______________________________________ | |
| 29 | + * | |
| 30 | + */ | |
| 31 | + | |
| 2 | 32 | require_once(dirname(__FILE__) . '/../test.php'); |
| 3 | 33 | require_once(KT_DIR . '/ktapi/ktapi.inc.php'); |
| 4 | 34 | ... | ... |
tests/runtests.php
| ... | ... | @@ -5,9 +5,9 @@ require_once('test.php'); |
| 5 | 5 | class UnitTests extends GroupTest { |
| 6 | 6 | function UnitTests() { |
| 7 | 7 | $this->GroupTest('Unit tests'); |
| 8 | - $this->addTestFile('api/authentication.php'); | |
| 9 | - $this->addTestFile('api/document.php'); | |
| 10 | - $this->addTestFile('api/folder.php'); | |
| 8 | + //$this->addTestFile('api/authentication.php'); | |
| 9 | + //$this->addTestFile('api/document.php'); | |
| 10 | + //$this->addTestFile('api/folder.php'); | |
| 11 | 11 | $this->addTestFile('SQLFile/test_sqlfile.php'); |
| 12 | 12 | $this->addTestFile('cache/testCache.php'); |
| 13 | 13 | $this->addTestFile('config/testConfig.php'); | ... | ... |