Commit e2b21b7135b60c32cbf9a2dbeb27530d82d513a7
1 parent
7ed3c13b
changed error message checking to use nulls
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@332 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
13 additions
and
13 deletions
tests/documentmanagement/DocumentBrowser.php
| @@ -32,9 +32,9 @@ if (checkSession()) { | @@ -32,9 +32,9 @@ if (checkSession()) { | ||
| 32 | // default browse- should resolve to root folder | 32 | // default browse- should resolve to root folder |
| 33 | echo "default browse- starts at this users root folder<br>"; | 33 | echo "default browse- starts at this users root folder<br>"; |
| 34 | $artifacts = $db->browseByFolder(); | 34 | $artifacts = $db->browseByFolder(); |
| 35 | - if (isset($_SESSION["errorMessage"])) { | 35 | + if (!is_null($_SESSION["errorMessage"])) { |
| 36 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 36 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 37 | - $_SESSION["errorMessage"] = "NULL"; | 37 | + $_SESSION["errorMessage"] = NULL; |
| 38 | } | 38 | } |
| 39 | print_r($artifacts); | 39 | print_r($artifacts); |
| 40 | 40 | ||
| @@ -42,18 +42,18 @@ if (checkSession()) { | @@ -42,18 +42,18 @@ if (checkSession()) { | ||
| 42 | $folderID = 3; | 42 | $folderID = 3; |
| 43 | echo "browse- starting at folder (folderID=$folderID)<br>"; | 43 | echo "browse- starting at folder (folderID=$folderID)<br>"; |
| 44 | $artifacts = $db->browseByFolder($folderID); | 44 | $artifacts = $db->browseByFolder($folderID); |
| 45 | - if (isset($_SESSION["errorMessage"])) { | 45 | + if (!is_null($_SESSION["errorMessage"])) { |
| 46 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 46 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 47 | - $_SESSION["errorMessage"] = "NULL"; | 47 | + $_SESSION["errorMessage"] = NULL; |
| 48 | } | 48 | } |
| 49 | print_r($artifacts); | 49 | print_r($artifacts); |
| 50 | 50 | ||
| 51 | // browse by category | 51 | // browse by category |
| 52 | echo "category browse- return a list of categories:<br>"; | 52 | echo "category browse- return a list of categories:<br>"; |
| 53 | $categories = $db->browseByCategory(); | 53 | $categories = $db->browseByCategory(); |
| 54 | - if (isset($_SESSION["errorMessage"])) { | 54 | + if (!is_null($_SESSION["errorMessage"])) { |
| 55 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 55 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 56 | - $_SESSION["errorMessage"] = "NULL"; | 56 | + $_SESSION["errorMessage"] = NULL; |
| 57 | } | 57 | } |
| 58 | print_r($categories); | 58 | print_r($categories); |
| 59 | 59 | ||
| @@ -63,18 +63,18 @@ if (checkSession()) { | @@ -63,18 +63,18 @@ if (checkSession()) { | ||
| 63 | $category = $categories[$rand_keys]; | 63 | $category = $categories[$rand_keys]; |
| 64 | echo "browsing by category = $category<br>"; | 64 | echo "browsing by category = $category<br>"; |
| 65 | $artifacts = $db->browseByCategory($category); | 65 | $artifacts = $db->browseByCategory($category); |
| 66 | - if (isset($_SESSION["errorMessage"])) { | 66 | + if (!is_null($_SESSION["errorMessage"])) { |
| 67 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 67 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 68 | - $_SESSION["errorMessage"] = "NULL"; | ||
| 69 | - } | 68 | + $_SESSION["errorMessage"] = NULL; |
| 69 | + } | ||
| 70 | print_r($artifacts); | 70 | print_r($artifacts); |
| 71 | 71 | ||
| 72 | // document type browsing | 72 | // document type browsing |
| 73 | echo "document type browse- get list of doc types<br>"; | 73 | echo "document type browse- get list of doc types<br>"; |
| 74 | $documentTypes = $db->browseByDocumentType(); | 74 | $documentTypes = $db->browseByDocumentType(); |
| 75 | - if (isset($_SESSION["errorMessage"])) { | 75 | + if (!is_null($_SESSION["errorMessage"])) { |
| 76 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 76 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 77 | - $_SESSION["errorMessage"] = "NULL"; | 77 | + $_SESSION["errorMessage"] = NULL; |
| 78 | } | 78 | } |
| 79 | print_r($documentTypes); | 79 | print_r($documentTypes); |
| 80 | 80 | ||
| @@ -84,9 +84,9 @@ if (checkSession()) { | @@ -84,9 +84,9 @@ if (checkSession()) { | ||
| 84 | 84 | ||
| 85 | echo "browsing by document type = " . $documentTypeID . "<br>"; | 85 | echo "browsing by document type = " . $documentTypeID . "<br>"; |
| 86 | $artifacts = $db->browseByDocumentType($documentTypeID); | 86 | $artifacts = $db->browseByDocumentType($documentTypeID); |
| 87 | - if (isset($_SESSION["errorMessage"])) { | 87 | + if (!is_null($_SESSION["errorMessage"])) { |
| 88 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; | 88 | echo "error: " . $_SESSION["errorMessage"] . "<br>"; |
| 89 | - $_SESSION["errorMessage"] = "NULL"; | 89 | + $_SESSION["errorMessage"] = NULL; |
| 90 | } | 90 | } |
| 91 | print_r($artifacts); | 91 | print_r($artifacts); |
| 92 | 92 |