From 74eca8d1f4d261e9364e65052edc60f247698439 Mon Sep 17 00:00:00 2001 From: jennylee Date: Tue, 30 Oct 2012 15:42:00 -0400 Subject: [PATCH] TEST UNIT BUG-8965 I added the TestUnit from 'downloadDoc' function of 'class.pmAlfrescoFunctions.php' class. --- .../triggers/pmAlfrescoFunctionsTest.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/unit/backend/workflow/engine/classes/triggers/pmAlfrescoFunctionsTest.php diff --git a/tests/unit/backend/workflow/engine/classes/triggers/pmAlfrescoFunctionsTest.php b/tests/unit/backend/workflow/engine/classes/triggers/pmAlfrescoFunctionsTest.php new file mode 100644 index 000000000..189647bf5 --- /dev/null +++ b/tests/unit/backend/workflow/engine/classes/triggers/pmAlfrescoFunctionsTest.php @@ -0,0 +1,44 @@ +object = new pmAlfrescoFunctions(); + } + + protected function tearDown() + { + } + + public function testDownloadDoc() + { + $alfrescoServerUrl = 'http://192.168.11.30:8080/alfresco'; + $pathFile = 'notas.txt'; + $pathFile1 = 'notas222.txt'; + $pathFolder = '/tmp'; + $pathFolder1 = '/home/jennyleekkkkk/processmaker'; + $user = 'admin'; + $pwd = 'atopml2005'; + + $adownloadDoc = downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder, $user, $pwd); + + try { + $adownloadDoc1 = downloadDoc($alfrescoServerUrl, $pathFile, $pathFolder1, $user, $pwd); + } catch (Exception $e) { + $this->assertEquals( "Undefined index: HTTP_REFERER", $e->getMessage(), 'ERROR!'); + } + + $this->assertEquals($adownloadDoc, true); + + try { + $adownloadDoc1 = downloadDoc($alfrescoServerUrl, $pathFile1, $pathFolder, $user, $pwd); + } catch (Exception $e) { + $this->assertEquals( "simplexml_load_string(): Entity: line 1: parser error : Entity 'nbsp' not defined", $e->getMessage(), 'ERROR!'); + } + } +} \ No newline at end of file