Se agrega test unit para OUTPUT DOCUMENT. Se agrega una linea en la respuesta de upload.
This commit is contained in:
@@ -214,6 +214,7 @@ class InputDocument
|
||||
$arrayData["DEL_INDEX"] = $delIndex;
|
||||
$arrayData["TAS_UID"] = $taskUid;
|
||||
$case->updateCase($applicationUid, $arrayData);
|
||||
return($this->getCasesInputDocument($applicationUid, $userUid, $appDocUid));
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,59 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
protected $oOutputDocument;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $proUid = "00000000000000000000000000000002";
|
||||
protected static $tasUid = "00000000000000000000000000000003";
|
||||
protected static $outUid = "00000000000000000000000000000004";
|
||||
protected static $steUid = "00000000000000000000000000000005";
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$process = new \Process();
|
||||
$process->create(array("type"=>"classicProject", "PRO_TITLE"=> "NEW TEST PHP UNIT", "PRO_DESCRIPTION"=> "465",
|
||||
"PRO_CATEGORY"=> "", "PRO_CREATE_USER"=> "00000000000000000000000000000001",
|
||||
"PRO_UID"=> self::$proUid, "USR_UID"=> "00000000000000000000000000000001"), false);
|
||||
|
||||
$task = new \Task();
|
||||
$task->create(array("TAS_START"=>"TRUE", "TAS_UID"=> self::$tasUid, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TEST PHP UNIT",
|
||||
"TAS_POSX"=> 581, "TAS_POSY"=> 17, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
|
||||
$outputDocument = new \OutputDocument();
|
||||
$outputDocument->create(array("OUT_DOC_UID"=> self::$outUid, "PRO_UID"=> self::$proUid, "OUT_DOC_TITLE"=> "NEW OUPUT TEST", "OUT_DOC_FILENAME"=> "NEW_OUPUT_TEST",
|
||||
"OUT_DOC_DESCRIPTION"=> "", "OUT_DOC_REPORT_GENERATOR"=> "HTML2PDF", "OUT_DOC_REPORT_GENERATOR_label"=> "HTML2PDF (Old Version)",
|
||||
"OUT_DOC_LANDSCAPE"=> "", "OUT_DOC_LANDSCAPE_label"=> "Portrait", "OUT_DOC_GENERATE"=> "BOTH", "OUT_DOC_GENERATE_label"=> "BOTH",
|
||||
"OUT_DOC_VERSIONING"=> "", "OUT_DOC_VERSIONING_label"=> "NO", "OUT_DOC_MEDIA"=> "Letter", "OUT_DOC_MEDIA_label"=> "Letter",
|
||||
"OUT_DOC_LEFT_MARGIN"=> "", "OUT_DOC_RIGHT_MARGIN"=> "", "OUT_DOC_TOP_MARGIN"=> "", "OUT_DOC_BOTTOM_MARGIN"=> "",
|
||||
"OUT_DOC_DESTINATION_PATH"=> "", "OUT_DOC_TAGS"=> "", "OUT_DOC_PDF_SECURITY_ENABLED"=> "0", "OUT_DOC_PDF_SECURITY_ENABLED_label"=> "Disabled",
|
||||
"OUT_DOC_PDF_SECURITY_OPEN_PASSWORD"=>"", "OUT_DOC_PDF_SECURITY_OWNER_PASSWORD"=> "", "OUT_DOC_PDF_SECURITY_PERMISSIONS"=> "",
|
||||
"OUT_DOC_OPEN_TYPE"=> "0", "OUT_DOC_OPEN_TYPE_label"=> "Download the file", "BTN_CANCEL"=> "Cancel", "ACCEPT"=> "Save"));
|
||||
|
||||
$step = new \Step();
|
||||
$step->create(array( "PRO_UID"=> self::$proUid, "TAS_UID"=> self::$tasUid, "STEP_UID"=> self::$steUid, "STEP_TYPE_OBJ" => "OUTPUT_DOCUMENT", "STEP_UID_OBJ" =>self::$outUid));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$assign = new \TaskUser();
|
||||
$assign->remove(self::$tasUid, self::$usrUid, 1,1);
|
||||
|
||||
$step = new \Step();
|
||||
$step->remove(self::$steUid);
|
||||
|
||||
$outputDocument = new \OutputDocument();
|
||||
$outputDocument->remove(self::$outUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
@@ -40,13 +93,8 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
public function testAddCasesOutputDocument()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
\G::loadClass('pmFunctions');
|
||||
$usrUid = '00000000000000000000000000000001';//an user id valid
|
||||
$proUid = '1265557095225ff5c688f46031700471';//a process id valid
|
||||
$tasUid = '46941969352af5be2ab3f39001216717';//a task id valid and related to the previous proUid
|
||||
$outDocUid = '64016692453346d546d0ad1037377043';//a output document id valid and related to the previous task id
|
||||
$idCase = PMFNewCase($proUid, $usrUid, $tasUid, array());
|
||||
$response = $this->oOutputDocument->addCasesOutputDocument($idCase, $outDocUid, '00000000000000000000000000000001');
|
||||
$idCase = PMFNewCase(self::$proUid, self::$usrUid, self::$tasUid, array());
|
||||
$response = $this->oOutputDocument->addCasesOutputDocument($idCase, self::$outUid, self::$usrUid);
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponse = json_decode(json_encode($response), true);
|
||||
$aResponse = array_merge(array("idCase" => $idCase), $aResponse);
|
||||
@@ -64,7 +112,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetCasesOutputDocuments(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocuments($aResponse["idCase"], '00000000000000000000000000000001');
|
||||
$response = $this->oOutputDocument->getCasesOutputDocuments($aResponse["idCase"], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
@@ -79,7 +127,7 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetCasesOutputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], '00000000000000000000000000000001', $aResponse["app_doc_uid"]);
|
||||
$response = $this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], self::$usrUid, $aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
@@ -96,5 +144,9 @@ class OutputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$response = $this->oOutputDocument->removeOutputDocument($aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(empty($response));
|
||||
|
||||
//remove Case
|
||||
$case = new \Cases();
|
||||
$case->removeCase( $aResponse["idCase"] );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user