HOR-3560
This commit is contained in:
@@ -1,403 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class CalendarTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CalendarTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $calendar;
|
||||
protected static $numCalendar = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$calendar = new \ProcessMaker\BusinessModel\Calendar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numCalendar - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar$i",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
"CAL_WORK_HOUR" => array(
|
||||
array("DAY" => 0, "HOUR_START" => "00:00", "HOUR_END" => "00:00"),
|
||||
array("DAY" => 1, "HOUR_START" => "09:00", "HOUR_END" => "17:00")
|
||||
),
|
||||
"CAL_HOLIDAY" => array(
|
||||
array("NAME" => "holiday1", "DATE_START" => "2014-03-01", "DATE_END" => "2014-03-31"),
|
||||
array("NAME" => "holiday2", "DATE_START" => "2014-03-01", "DATE_END" => "2014-03-31")
|
||||
)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertTrue(isset($arrayCalendar["CAL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCalendar;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "私の名前(PHPUnitの)",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertTrue(isset($arrayCalendar["CAL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCalendar;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testUpdate($arrayRecord)
|
||||
{
|
||||
$arrayData = array("CAL_DESCRIPTION" => "Description...");
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[1]["CAL_UID"], $arrayData);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[1]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], $arrayData["CAL_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::getCalendars
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testGetCalendars($arrayRecord)
|
||||
{
|
||||
$arrayCalendar = self::$calendar->getCalendars();
|
||||
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayCalendar);
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_UID"], $arrayRecord[0]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_NAME"], $arrayRecord[0]["CAL_NAME"]);
|
||||
$this->assertEquals($arrayCalendar[0]["CAL_DESCRIPTION"], $arrayRecord[0]["CAL_DESCRIPTION"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get calendar
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::getCalendar
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testGetCalendar($arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[0]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_UID"], $arrayRecord[0]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_NAME"], $arrayRecord[0]["CAL_NAME"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], $arrayRecord[0]["CAL_DESCRIPTION"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayCalendar = self::$calendar->getCalendar($arrayRecord[self::$numCalendar]["CAL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertNotEmpty($arrayCalendar);
|
||||
|
||||
$this->assertEquals($arrayCalendar["CAL_UID"], $arrayRecord[self::$numCalendar]["CAL_UID"]);
|
||||
$this->assertEquals($arrayCalendar["CAL_NAME"], "私の名前(PHPUnitの)");
|
||||
$this->assertEquals($arrayCalendar["CAL_DESCRIPTION"], "Description");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when data not is array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", this value must be an array.
|
||||
*/
|
||||
public function testCreateExceptionNoIsArrayData()
|
||||
{
|
||||
$arrayData = 0;
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "CAL_NAME", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
//"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_NAME", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_WORK_DAYS)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_WORK_DAYS", it only accepts values: "1|2|3|4|5|6|7".
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCalWorkDays()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(10, 2, 3, 4, 5)
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for calendar name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar name with CAL_NAME: "PHPUnit Calendar0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsCalName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar0",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when data not is array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", this value must be an array.
|
||||
*/
|
||||
public function testUpdateExceptionNoIsArrayData()
|
||||
{
|
||||
$arrayData = 0;
|
||||
|
||||
$arrayCalendar = self::$calendar->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCalendar = self::$calendar->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid calendar UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar with CAL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidCalUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_NAME", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCalName($arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(1, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAL_WORK_DAYS)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAL_WORK_DAYS", it only accepts values: "1|2|3|4|5|6|7".
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCalWorkDays($arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAL_NAME" => "PHPUnit Calendar",
|
||||
"CAL_DESCRIPTION" => "Description",
|
||||
"CAL_WORK_DAYS" => array(10, 2, 3, 4, 5),
|
||||
);
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for calendar name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The calendar name with CAL_NAME: "PHPUnit Calendar1" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsCalName($arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[1];
|
||||
|
||||
$arrayCalendar = self::$calendar->update($arrayRecord[0]["CAL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete calendars
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Calendar::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the calendars
|
||||
*/
|
||||
public function testDelete($arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$calendar->delete($value["CAL_UID"]);
|
||||
}
|
||||
|
||||
$arrayCalendar = self::$calendar->getCalendars(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCalendar));
|
||||
$this->assertEmpty($arrayCalendar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,392 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesAction13_17Test extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
protected $nowCountTodo = 0;
|
||||
protected $nowCountDraft = 0;
|
||||
protected $nowCountPaused = 0;
|
||||
protected $idCaseToDo = '';
|
||||
protected $idCaseDraft = '';
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
|
||||
$usrUid = '00000000000000000000000000000001';
|
||||
$proUid = '2317283235320c1a36972b2028131767';
|
||||
$tasUid = '7983935495320c1a75e1df6068322280';
|
||||
$idCaseToDo = PMFNewCase($proUid, $usrUid, $tasUid, array());
|
||||
PMFDerivateCase($idCaseToDo, 1);
|
||||
$this->idCaseToDo = $idCaseToDo;
|
||||
|
||||
$idCaseDraft = PMFNewCase($proUid, $usrUid, $tasUid, array());
|
||||
$this->idCaseDraft = $idCaseDraft;
|
||||
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->nowCountTodo = $listToDo['total'];
|
||||
|
||||
$listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->nowCountDraft = $listDraft['total'];
|
||||
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->nowCountPaused = $listPaused['total'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putCancelCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putCancelCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutCancelCase()
|
||||
{
|
||||
$this->oCases->putCancelCase($this->idCaseDraft, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listDraft = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->assertNotEquals($this->nowCountDraft, $listDraft['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putPauseCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in fourth field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The value '2014-44-44' is not a valid date for the format 'Y-m-d'.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCaseErrorDateIncorrect()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseDraft, '00000000000000000000000000000001', false, '2014-44-44');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putPauseCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutPauseCase()
|
||||
{
|
||||
$this->oCases->putPauseCase($this->idCaseToDo, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->assertNotEquals($this->nowCountPaused, $listPaused['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->putUnpauseCase(array(), '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase('IdDoesNotExists', '00000000000000000000000000000001');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$usr_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorUsrUidArray()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with $usr_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorUsrUidIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, 'IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in third field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$del_index' it must be a integer.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCaseErrorDelIndexIncorrect()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseDraft, '00000000000000000000000000000001', 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::putUnpauseCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testPutUnpauseCase()
|
||||
{
|
||||
$this->oCases->putUnpauseCase($this->idCaseToDo, '00000000000000000000000000000001');
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listPaused = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'paused'));
|
||||
$this->assertEquals($this->nowCountPaused, $listPaused['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$app_uid' it must be a string.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCaseErrorAppUidArray()
|
||||
{
|
||||
$this->oCases->deleteCase(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The application with $app_uid: 'IdDoesNotExists' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCaseErrorAppUidIncorrect()
|
||||
{
|
||||
$this->oCases->deleteCase('IdDoesNotExists');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for cancel case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::deleteCase
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteCase()
|
||||
{
|
||||
$this->oCases->deleteCase($this->idCaseToDo);
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$listToDo = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->assertNotEquals($this->nowCountTodo, $listToDo['total']);
|
||||
}
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$dataList' it must be an array.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorArray()
|
||||
{
|
||||
$this->oCases->getList(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for empty userId in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with userId: '' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorUserIdArray()
|
||||
{
|
||||
$this->oCases->getList(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for not exists userId in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with userId: 'UidInexistente' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorNotExistsUserIdArray()
|
||||
{
|
||||
$this->oCases->getList(array('userId' => 'UidInexistente'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value $action in array
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The value for $action is incorrect.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesErrorIncorrectValueArray()
|
||||
{
|
||||
$this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'incorrect'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list to do
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesToDo()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list draft
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesDraft()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'draft'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list participated
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesParticipated()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'sent'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list unassigned
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesUnassigned()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'unassigned'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get list search
|
||||
*
|
||||
* @covers \BusinessModel\Cases::getList
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetListCasesSearch()
|
||||
{
|
||||
$response = $this->oCases->getList(array('userId' => '00000000000000000000000000000001', 'action' => 'search'));
|
||||
$this->assertTrue(is_array($response));
|
||||
$this->assertTrue(is_numeric($response['totalCount']));
|
||||
$this->assertTrue(is_array($response['data']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,356 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class CasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oCases;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $usrUid2 = "00000000000000000000000000000012";
|
||||
protected static $proUid = "00000000000000000000000000000003";
|
||||
protected static $tasUid = "00000000000000000000000000000004";
|
||||
protected static $tasUid2 = "00000000000000000000000000000005";
|
||||
protected static $tasUid3 = "00000000000000000000000000000006";
|
||||
|
||||
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"=> 47, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
$task = new \Task();
|
||||
$task->create(array( "TAS_UID"=> self::$tasUid2, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK ONE",
|
||||
"TAS_POSX"=> 481, "TAS_POSY"=> 127, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
$task = new \Task();
|
||||
$task->create(array( "TAS_UID"=> self::$tasUid3, "PRO_UID"=> self::$proUid, "TAS_TITLE" => "NEW TASK TWO",
|
||||
"TAS_POSX"=> 681, "TAS_POSY"=> 127, "TAS_WIDTH"=> 165, "TAS_HEIGHT"=> 40), false);
|
||||
|
||||
$nw = new \processMap();
|
||||
$nw->saveNewPattern(self::$proUid, self::$tasUid, self::$tasUid2, 'PARALLEL', true);
|
||||
$nw = new \processMap();
|
||||
$nw->saveNewPattern(self::$proUid, self::$tasUid, self::$tasUid3, 'PARALLEL', true);
|
||||
|
||||
$user = new \Users();
|
||||
$user->create(array("USR_ROLE"=> "PROCESSMAKER_ADMIN","USR_UID"=> self::$usrUid2, "USR_USERNAME"=> "dummy",
|
||||
"USR_PASSWORD"=>"21232f297a57a5a743894a0e4a801fc3", "USR_FIRSTNAME"=>"dummy_firstname", "USR_LASTNAME"=>"dummy_lastname",
|
||||
"USR_EMAIL"=>"dummy@dummy.com", "USR_DUE_DATE"=>'2020-01-01', "USR_CREATE_DATE"=>"2014-01-01 12:00:00", "USR_UPDATE_DATE"=>"2014-01-01 12:00:00",
|
||||
"USR_STATUS"=>"ACTIVE", "USR_UX"=>"NORMAL"));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid2, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid2, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid3, "USR_UID"=> self::$usrUid, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
$assign = new \TaskUser();
|
||||
$assign->create(array("TAS_UID"=> self::$tasUid3, "USR_UID"=> self::$usrUid2, "TU_TYPE"=> "1", "TU_RELATION"=> 1));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oCases = new \ProcessMaker\BusinessModel\Cases();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of process in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid process 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseErrorIncorrectProcessValueArray()
|
||||
{
|
||||
$this->oCases->addCase('12345678912345678912345678912345678', self::$tasUid, self::$usrUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Task invalid or the user is not assigned to the task
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseErrorIncorrectTaskValueArray()
|
||||
{
|
||||
$this->oCases->addCase(self::$proUid, '12345678912345678912345678912345678', self::$usrUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add Case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCase()
|
||||
{
|
||||
$response = $this->oCases->addCase(self::$proUid, self::$tasUid, self::$usrUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponse = json_decode(json_encode($response), true);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getTaskCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Incorrect or unavailable information about this case: 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetTaskCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->getTaskCase('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get Task Case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getTaskCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetTaskCase(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->getTaskCase($aResponse['app_uid'], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCaseInfoErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->getCaseInfo('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get Case Info
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::getCaseInfo
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCaseInfo(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->getCaseInfo($aResponse['app_uid'], self::$usrUid);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of user delegation in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid Case Delegation index for this user
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCaseErrorIncorrectUserValueArray(array $aResponse)
|
||||
{
|
||||
$this->oCases->updateReassignCase($aResponse['app_uid'], self::$usrUid, null, self::$usrUid, self::$usrUid2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application with app_uid: 12345678912345678912345678912345678 doesn't exist
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->updateReassignCase('12345678912345678912345678912345678', self::$usrUid, null, self::$usrUid2, self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test put reassign case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateReassignCase
|
||||
* @depends testAddCase
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateReassignCase(array $aResponse)
|
||||
{
|
||||
$response = $this->oCases->updateReassignCase($aResponse['app_uid'], self::$usrUid, null, self::$usrUid2, self::$usrUid);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add Case to test route case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseRouteCase()
|
||||
{
|
||||
$response = $this->oCases->addCase(self::$proUid, self::$tasUid, self::$usrUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
$aResponseRouteCase = json_decode(json_encode($response), true);
|
||||
return $aResponseRouteCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The row '12345678912345678912345678912345678, ' in table AppDelegation doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateRouteCaseErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oCases->updateRouteCase('12345678912345678912345678912345678', self::$usrUid, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test put route case
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::updateRouteCase
|
||||
* @depends testAddCaseRouteCase
|
||||
* @param array $aResponseRouteCase
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateRouteCase(array $aResponseRouteCase)
|
||||
{
|
||||
$response = $this->oCases->updateRouteCase($aResponseRouteCase['app_uid'], self::$usrUid, null);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of process in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid process 12345678912345678912345678912345678
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonateErrorIncorrectProcessValueArray()
|
||||
{
|
||||
$this->oCases->addCaseImpersonate('12345678912345678912345678912345678', self::$usrUid2, self::$tasUid, array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCase
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage User not registered! 12345678912345678912345678912345678!!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonateErrorIncorrectTaskValueArray()
|
||||
{
|
||||
$this->oCases->addCaseImpersonate(self::$proUid, '12345678912345678912345678912345678', self::$tasUid, array());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test add Case impersonate
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases::addCaseImpersonate
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCaseImpersonate()
|
||||
{
|
||||
$response = $this->oCases->addCaseImpersonate(self::$proUid, self::$usrUid2, self::$tasUid, array());
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$assign = new \TaskUser();
|
||||
$assign->remove(self::$tasUid, self::$usrUid, 1,1);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid2);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid3);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
$criteria->addSelectColumn(\RoutePeer::PRO_UID);
|
||||
$criteria->add(\RoutePeer::PRO_UID, self::$proUid, \Criteria::EQUAL);
|
||||
\ProcessFilesPeer::doDelete($criteria);
|
||||
|
||||
$user = new \Users();
|
||||
$user->remove(self::$usrUid2);
|
||||
|
||||
$oConnection = \Propel::getConnection( \UsersPeer::DATABASE_NAME );
|
||||
try {
|
||||
$oUser = \UsersPeer::retrieveByPK( self::$usrUid2 );
|
||||
if (! is_null( $oUser )) {
|
||||
$oConnection->begin();
|
||||
$oUser->delete();
|
||||
$oConnection->commit();
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,354 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Department Test
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class DepartmentTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oDepartment;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oDepartment = new \ProcessMaker\BusinessModel\Department();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$dep_data' it must be an array.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArray()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for type in second field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for '$create' it must be a boolean.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorBoolean()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(array('1'),array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for empty array in first field the function
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The field '$dep_data' is empty.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayEmpty()
|
||||
{
|
||||
$this->oDepartment->saveDepartment(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with nonexistent dep_parent
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_parent: 'testUidDepartment' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepParentExist()
|
||||
{
|
||||
$data = array('dep_parent' => 'testUidDepartment');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with nonexistent dep_manager
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The user with dep_manager: 'testUidUser' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepManagerExist()
|
||||
{
|
||||
$data = array('dep_manager' => 'testUidUser');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with incorrect dep_status
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_status: 'SUPER ACTIVO' is incorrect.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepStatus()
|
||||
{
|
||||
$data = array('dep_status' => 'SUPER ACTIVO');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department untitled
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The field dep_title is required.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepTitleEmpty()
|
||||
{
|
||||
$data = array('dep_status' => 'ACTIVE');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save department parent
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentParent()
|
||||
{
|
||||
$data = array('dep_title' => 'Departamento Padre');
|
||||
$dep_data = $this->oDepartment->saveDepartment($data);
|
||||
$this->assertTrue(is_array($dep_data));
|
||||
$this->assertTrue(isset($dep_data['dep_uid']));
|
||||
$this->assertEquals($dep_data['dep_parent'], '');
|
||||
$this->assertEquals($dep_data['dep_title'], 'Departamento Padre');
|
||||
$this->assertEquals($dep_data['dep_status'], 'ACTIVE');
|
||||
$this->assertEquals($dep_data['dep_manager'], '');
|
||||
$this->assertEquals($dep_data['has_children'], 0);
|
||||
return $dep_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department with title exist
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentErrorArrayDepTitleRepeated(array $dep_data)
|
||||
{
|
||||
$data = array('dep_title' => 'Departamento Padre');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for create department untitled
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_uid: 'testUidDepartment' does not exist.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateDepartmentErrorArrayDepUidExist()
|
||||
{
|
||||
$data = array('dep_uid' => 'testUidDepartment');
|
||||
$this->oDepartment->saveDepartment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save department child
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testCreateDepartmentChild(array $dep_data)
|
||||
{
|
||||
$data = array(
|
||||
'dep_title' => 'Departamento Child',
|
||||
'dep_parent' => $dep_data['dep_uid'],
|
||||
'dep_status' => 'INACTIVE',
|
||||
'dep_manager' => '00000000000000000000000000000001'
|
||||
);
|
||||
$child_data = $this->oDepartment->saveDepartment($data);
|
||||
$this->assertTrue(is_array($child_data));
|
||||
$this->assertTrue(isset($child_data['dep_uid']));
|
||||
$this->assertEquals($child_data['dep_parent'], $dep_data['dep_uid']);
|
||||
$this->assertEquals($child_data['dep_title'], 'Departamento Child');
|
||||
$this->assertEquals($child_data['dep_status'], 'INACTIVE');
|
||||
$this->assertEquals($child_data['dep_manager'], '00000000000000000000000000000001');
|
||||
$this->assertEquals($child_data['has_children'], 0);
|
||||
return $child_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for update department with title exist
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::saveDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The departament with dep_title: 'Departamento Padre' already exists.
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testUpdateDepartmentErrorArrayDepTitleRepeated(array $dep_data, array $child_data)
|
||||
{
|
||||
$dataUpdate = array (
|
||||
'dep_uid' => $child_data['dep_uid'],
|
||||
'dep_title' => 'Departamento Padre'
|
||||
);
|
||||
$this->oDepartment->saveDepartment($dataUpdate, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get departments array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::getDepartments
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetDepartments(array $dep_data, array $child_data)
|
||||
{
|
||||
$arrayDepartments = $this->oDepartment->getDepartments();
|
||||
$this->assertTrue(is_array($arrayDepartments));
|
||||
$this->assertEquals(count($arrayDepartments), 1);
|
||||
$this->assertTrue(is_array($arrayDepartments[0]['dep_children']));
|
||||
$this->assertEquals(count($arrayDepartments[0]['dep_children']), 1);
|
||||
|
||||
$dataParent = $arrayDepartments[0];
|
||||
$this->assertEquals($dep_data['dep_parent'], $dataParent['dep_parent']);
|
||||
$this->assertEquals($dep_data['dep_title'], $dataParent['dep_title']);
|
||||
$this->assertEquals($dep_data['dep_status'], $dataParent['dep_status']);
|
||||
$this->assertEquals($dep_data['dep_manager'], $dataParent['dep_manager']);
|
||||
|
||||
$dataChild = $arrayDepartments[0]['dep_children'][0];
|
||||
$this->assertEquals($child_data['dep_parent'], $dataChild['dep_parent']);
|
||||
$this->assertEquals($child_data['dep_title'], $dataChild['dep_title']);
|
||||
$this->assertEquals($child_data['dep_status'], $dataChild['dep_status']);
|
||||
$this->assertEquals($child_data['dep_manager'], $dataChild['dep_manager']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get department array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::getDepartment
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetDepartment(array $dep_data)
|
||||
{
|
||||
$dataParent = $this->oDepartment->getDepartment($dep_data['dep_uid']);
|
||||
$this->assertTrue(is_array($dataParent));
|
||||
|
||||
$this->assertEquals($dep_data['dep_parent'], $dataParent['dep_parent']);
|
||||
$this->assertEquals($dep_data['dep_title'], $dataParent['dep_title']);
|
||||
$this->assertEquals($dep_data['dep_status'], $dataParent['dep_status']);
|
||||
$this->assertEquals($dep_data['dep_manager'], $dataParent['dep_manager']);
|
||||
}
|
||||
|
||||
// TODO: Assigned Users to department
|
||||
public function testDeleteDepartmentErrorUsersSelections()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for delete department with children
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Can not delete the department, it has a children department.
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteDepartmentErrorDepartmentParent(array $dep_data, array $child_data)
|
||||
{
|
||||
$this->oDepartment->deleteDepartment($dep_data['dep_uid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get departments array
|
||||
*
|
||||
* @depends testCreateDepartmentParent
|
||||
* @depends testCreateDepartmentChild
|
||||
* @param array $dep_data, Data for parent department
|
||||
* @param array $child_data, Data for child department
|
||||
* @covers \ProcessMaker\BusinessModel\Department::deleteDepartment
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testDeleteDepartments(array $dep_data, array $child_data)
|
||||
{
|
||||
$this->oDepartment->deleteDepartment($child_data['dep_uid']);
|
||||
$this->oDepartment->deleteDepartment($dep_data['dep_uid']);
|
||||
$dataParent = $this->oDepartment->getDepartments();
|
||||
$this->assertTrue(empty($dataParent));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,204 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Documents Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class InputDocumentsCasesTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $oInputDocument;
|
||||
protected $idCase = '';
|
||||
|
||||
protected static $usrUid = "00000000000000000000000000000001";
|
||||
protected static $proUid = "00000000000000000000000000000002";
|
||||
protected static $tasUid = "00000000000000000000000000000003";
|
||||
protected static $inpUid = "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);
|
||||
|
||||
$inputDocument = new \InputDocument();
|
||||
$inputDocument->create(array("INP_DOC_UID"=> self::$inpUid, "PRO_UID"=> self::$proUid, "INP_DOC_TITLE"=> "INPUTDOCUMENT TEST UNIT", "INP_DOC_FORM_NEEDED"=> "VIRTUAL",
|
||||
"INP_DOC_ORIGINAL"=> "ORIGINAL", "INP_DOC_DESCRIPTION"=> "", "INP_DOC_VERSIONING"=> "",
|
||||
"INP_DOC_DESTINATION_PATH"=> "", "INP_DOC_TAGS"=> "INPUT", "ACCEPT"=> "Save", "BTN_CANCEL"=>"Cancel"));
|
||||
|
||||
$step = new \Step();
|
||||
$step->create(array( "PRO_UID"=> self::$proUid, "TAS_UID"=> self::$tasUid, "STEP_UID"=> self::$steUid, "STEP_TYPE_OBJ" => "INPUT_DOCUMENT", "STEP_UID_OBJ" =>self::$inpUid));
|
||||
|
||||
$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);
|
||||
|
||||
$inputDocument = new \InputDocument();
|
||||
$inputDocument->remove(self::$inpUid);
|
||||
|
||||
$task = new \Task();
|
||||
$task->remove(self::$tasUid);
|
||||
|
||||
$process = new \Process();
|
||||
$process->remove(self::$proUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oInputDocument = new \ProcessMaker\BusinessModel\Cases\InputDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add a test InputDocument
|
||||
*
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddInputDocument()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
$idCase = PMFNewCase(self::$proUid, self::$usrUid, self::$tasUid, array());
|
||||
$case = new \Cases();
|
||||
$appDocUid = $case->addInputDocument(self::$inpUid, $appDocUid = \G::generateUniqueID(), '', 'INPUT',
|
||||
'PHPUNIT TEST', '', $idCase, \AppDelegation::getCurrentIndex($idCase),
|
||||
self::$tasUid, self::$usrUid, "xmlform", PATH_DATA_SITE.'db.php',
|
||||
0, PATH_DATA_SITE.'db.php');
|
||||
$aResponse = array();
|
||||
$aResponse = array_merge(array("idCase" => $idCase, "appDocUid" => $appDocUid, "inpDocUid" => self::$inpUid), $aResponse);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of case in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentsErrorIncorrectCaseValueArray()
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocuments('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get InputDocuments
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocuments
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocuments(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->getCasesInputDocuments($aResponse["idCase"], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of task in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentErrorIncorrectCaseValueArray(array $aResponse)
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocument('12345678912345678912345678912345678', self::$usrUid, $aResponse["appDocUid"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of input document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This input document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocumentErrorIncorrectInputDocumentValueArray(array $aResponse)
|
||||
{
|
||||
$this->oInputDocument->getCasesInputDocument($aResponse["idCase"], self::$usrUid, '12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get InputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::getCasesInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesInputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->getCasesInputDocument($aResponse["idCase"], self::$usrUid, $aResponse["appDocUid"]);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of input document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This input document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveInputDocumentErrorIncorrectApplicationValueArray()
|
||||
{
|
||||
$this->oInputDocument->removeInputDocument('12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove InputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\InputDocument::removeInputDocument
|
||||
* @depends testAddInputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveInputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oInputDocument->removeInputDocument($aResponse["appDocUid"]);
|
||||
$this->assertTrue(empty($response));
|
||||
}
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once (__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class Documents Cases Test
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @protected
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @coversNothing
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
$this->oOutputDocument = new \ProcessMaker\BusinessModel\Cases\OutputDocument();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::addCasesOutputDocument
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testAddCasesOutputDocument()
|
||||
{
|
||||
\G::loadClass('pmFunctions');
|
||||
$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);
|
||||
return $aResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of application in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentsErrorIncorrectApplicationValueArray()
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocuments('12345678912345678912345678912345678', self::$usrUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get OutputDocuments
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocuments
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocuments(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocuments($aResponse["idCase"], self::$usrUid);
|
||||
$this->assertTrue(is_array($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of application in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The Application row '12345678912345678912345678912345678' doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentErrorIncorrectApplicationValueArray(array $aResponse)
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocument('12345678912345678912345678912345678', self::$usrUid, $aResponse["app_doc_uid"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of output document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This output document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocumentErrorIncorrectOutputDocumentValueArray(array $aResponse)
|
||||
{
|
||||
$this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], self::$usrUid, '12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::getCasesOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testGetCasesOutputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->getCasesOutputDocument($aResponse["idCase"], self::$usrUid, $aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(is_object($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test error for incorrect value of output document in array
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This output document with id: 12345678912345678912345678912345678 doesn't exist!
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveOutputDocumentErrorIncorrectOutputDocumentValueArray()
|
||||
{
|
||||
$this->oOutputDocument->removeOutputDocument('12345678912345678912345678912345678');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove OutputDocument
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Cases\OutputDocument::removeOutputDocument
|
||||
* @depends testAddCasesOutputDocument
|
||||
* @param array $aResponse
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function testRemoveOutputDocument(array $aResponse)
|
||||
{
|
||||
$response = $this->oOutputDocument->removeOutputDocument($aResponse["app_doc_uid"]);
|
||||
$this->assertTrue(empty($response));
|
||||
|
||||
//remove Case
|
||||
$case = new \Cases();
|
||||
$case->removeCase( $aResponse["idCase"] );
|
||||
}
|
||||
}
|
||||
@@ -1,320 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class ProcessCategoryTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class ProcessCategoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $category;
|
||||
protected static $numCategory = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$category = new \ProcessMaker\BusinessModel\ProcessCategory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numCategory - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category " . $i
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertTrue(isset($arrayCategory["CAT_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCategory;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "テスト(PHPUnitの)",
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertTrue(isset($arrayCategory["CAT_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayCategory;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testUpdate(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array("CAT_NAME" => "PHPUnit My Category 1...");
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[1]["CAT_UID"], $arrayData);
|
||||
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[1]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], $arrayData["CAT_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::getCategories
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testGetCategories(array $arrayRecord)
|
||||
{
|
||||
$arrayCategory = self::$category->getCategories();
|
||||
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$arrayCategory = self::$category->getCategories(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayCategory);
|
||||
|
||||
$arrayCategory = self::$category->getCategories(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory[0]["CAT_UID"], $arrayRecord[0]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory[0]["CAT_NAME"], $arrayRecord[0]["CAT_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get category
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::getCategory
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testGetCategory(array $arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[0]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_UID"], $arrayRecord[0]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], $arrayRecord[0]["CAT_NAME"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayCategory = self::$category->getCategory($arrayRecord[self::$numCategory]["CAT_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertNotEmpty($arrayCategory);
|
||||
|
||||
$this->assertEquals($arrayCategory["CAT_UID"], $arrayRecord[self::$numCategory]["CAT_UID"]);
|
||||
$this->assertEquals($arrayCategory["CAT_NAME"], "テスト(PHPUnitの)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "CAT_NAME", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAMEX" => "PHPUnit My Category N"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAT_NAME", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => ""
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for category name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category name with CAT_NAME: "PHPUnit My Category 0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsCatName()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category 0"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayCategory = self::$category->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid category UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category with CAT_UID: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidCatUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => "PHPUnit My Category N"
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (CAT_NAME)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "CAT_NAME", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataCatName(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"CAT_NAME" => ""
|
||||
);
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[0]["CAT_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for category name existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category name with CAT_NAME: "PHPUnit My Category 0" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsCatName(array $arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[0];
|
||||
|
||||
$arrayCategory = self::$category->update($arrayRecord[1]["CAT_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete categories
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the categories
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$category->delete($value["CAT_UID"]);
|
||||
}
|
||||
|
||||
$arrayCategory = self::$category->getCategories(array("filter" => "PHPUnit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayCategory));
|
||||
$this->assertEmpty($arrayCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid category UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\ProcessCategory::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The category with CAT_UID: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' does not exist.
|
||||
*/
|
||||
public function testDeleteExceptionInvalidCatUid()
|
||||
{
|
||||
self::$category->delete("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel\Role;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class PermissionTest
|
||||
*
|
||||
* @package Tests\BusinessModel\Role
|
||||
*/
|
||||
class PermissionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $role;
|
||||
protected static $roleUid = "";
|
||||
|
||||
protected static $rolePermission;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
//Role
|
||||
self::$role = new \ProcessMaker\BusinessModel\Role();
|
||||
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_0",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
self::$roleUid = $arrayRole["ROL_UID"];
|
||||
|
||||
//Role and Permission
|
||||
self::$rolePermission = new \ProcessMaker\BusinessModel\Role\Permission();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
self::$role->delete(self::$roleUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign permissions to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Permission
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
//Role and Permission - Create
|
||||
foreach ($arrayPermission as $value) {
|
||||
$perUid = $value["PER_UID"];
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, array("PER_UID" => $perUid));
|
||||
|
||||
$this->assertTrue(is_array($arrayRolePermission));
|
||||
$this->assertNotEmpty($arrayRolePermission);
|
||||
|
||||
$this->assertTrue(isset($arrayRolePermission["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRolePermission;
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get assigned permissions to role
|
||||
* Test get available permissions to assign to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::getPermissions
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the role-permission
|
||||
*/
|
||||
public function testGetPermissions(array $arrayRecord)
|
||||
{
|
||||
//PERMISSIONS
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS");
|
||||
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertTrue(is_array($arrayPermission));
|
||||
$this->assertNotEmpty($arrayPermission);
|
||||
|
||||
$this->assertEquals($arrayPermission[0]["PER_UID"], $arrayRecord[0]["PER_UID"]);
|
||||
|
||||
//AVAILABLE-PERMISSIONS
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "AVAILABLE-PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertEmpty($arrayPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testCreateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (PER_UID)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "PER_UID", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataPerUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"PER_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRolePermission = self::$rolePermission->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test unassign permissions of the role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the role-permission
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
$perUid = $value["PER_UID"];
|
||||
|
||||
self::$rolePermission->delete(self::$roleUid, $perUid);
|
||||
}
|
||||
|
||||
$arrayPermission = self::$rolePermission->getPermissions(self::$roleUid, "PERMISSIONS", array("filter" => "V"));
|
||||
|
||||
$this->assertTrue(is_array($arrayPermission));
|
||||
$this->assertEmpty($arrayPermission);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid permission UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\Permission::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The permission with PER_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testDeleteExceptionInvalidPerUid()
|
||||
{
|
||||
self::$rolePermission->delete(self::$roleUid, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel\Role;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class UserTest
|
||||
*
|
||||
* @package Tests\BusinessModel\Role
|
||||
*/
|
||||
class UserTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $user;
|
||||
protected static $roleUser;
|
||||
protected static $numUser = 2;
|
||||
protected static $roleUid = "00000000000000000000000000000002"; //PROCESSMAKER_ADMIN
|
||||
|
||||
protected static $arrayUsrUid = array();
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$user = new \ProcessMaker\BusinessModel\User();
|
||||
self::$roleUser = new \ProcessMaker\BusinessModel\Role\User();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
foreach (self::$arrayUsrUid as $value) {
|
||||
$usrUid = $value;
|
||||
|
||||
self::$user->delete($usrUid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign users to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//User
|
||||
$arrayAux = explode("-", date("Y-m-d"));
|
||||
$dueDate = date("Y-m-d", mktime(0, 0, 0, $arrayAux[1], $arrayAux[2] + 5, $arrayAux[0]));
|
||||
|
||||
for ($i = 0; $i <= self::$numUser - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"USR_USERNAME" => "userphpunit" . $i,
|
||||
"USR_FIRSTNAME" => "userphpunit" . $i,
|
||||
"USR_LASTNAME" => "userphpunit" . $i,
|
||||
"USR_EMAIL" => "userphpunit@email.com" . $i,
|
||||
"USR_COUNTRY" => "",
|
||||
"USR_ADDRESS" => "",
|
||||
"USR_PHONE" => "",
|
||||
"USR_ZIP_CODE" => "",
|
||||
"USR_POSITION" => "",
|
||||
"USR_REPLACED_BY" => "",
|
||||
"USR_DUE_DATE" => $dueDate,
|
||||
"USR_ROLE" => "PROCESSMAKER_OPERATOR",
|
||||
"USR_STATUS" => "ACTIVE",
|
||||
"USR_NEW_PASS" => "userphpunit" . $i,
|
||||
"USR_CNF_PASS" => "userphpunit" . $i
|
||||
);
|
||||
|
||||
$arrayUser = array_change_key_case(self::$user->create($arrayData), CASE_UPPER);
|
||||
|
||||
self::$arrayUsrUid[] = $arrayUser["USR_UID"];
|
||||
$arrayRecord[] = $arrayUser;
|
||||
}
|
||||
|
||||
//Role and User - Create
|
||||
foreach ($arrayRecord as $value) {
|
||||
$usrUid = $value["USR_UID"];
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, array("USR_UID" => $usrUid));
|
||||
|
||||
$this->assertTrue(is_array($arrayRoleUser));
|
||||
$this->assertNotEmpty($arrayRoleUser);
|
||||
|
||||
$this->assertTrue(isset($arrayRoleUser["ROL_UID"]));
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get assigned users to role
|
||||
* Test get available users to assign to role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::getUsers
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the users
|
||||
*/
|
||||
public function testGetUsers(array $arrayRecord)
|
||||
{
|
||||
//USERS
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS");
|
||||
|
||||
$this->assertNotEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayUser));
|
||||
$this->assertNotEmpty($arrayUser);
|
||||
|
||||
$this->assertEquals($arrayUser[0]["USR_UID"], $arrayRecord[0]["USR_UID"]);
|
||||
$this->assertEquals($arrayUser[0]["USR_USERNAME"], $arrayRecord[0]["USR_USERNAME"]);
|
||||
|
||||
//AVAILABLE-USERS
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "AVAILABLE-USERS", null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "AVAILABLE-USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertEmpty($arrayUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testCreateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (USR_UID)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "USR_UID", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataUsrUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"USR_UID" => "",
|
||||
);
|
||||
|
||||
$arrayRoleUser = self::$roleUser->create(self::$roleUid, $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test unassign users of the role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the users
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
$usrUid = $value["USR_UID"];
|
||||
|
||||
self::$roleUser->delete(self::$roleUid, $usrUid);
|
||||
}
|
||||
|
||||
$arrayUser = self::$roleUser->getUsers(self::$roleUid, "USERS", array("filter" => "userphpunit"));
|
||||
|
||||
$this->assertTrue(is_array($arrayUser));
|
||||
$this->assertEmpty($arrayUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for administrator's role can't be changed
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role\User::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The administrator's role can't be changed!
|
||||
*/
|
||||
public function testDeleteExceptionAdminRoleCantChanged()
|
||||
{
|
||||
self::$roleUser->delete(self::$roleUid, "00000000000000000000000000000001");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,330 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\BusinessModel;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
require_once(__DIR__ . "/../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class RoleTest
|
||||
*
|
||||
* @package Tests\BusinessModel
|
||||
*/
|
||||
class RoleTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $role;
|
||||
protected static $numRole = 2;
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$role = new \ProcessMaker\BusinessModel\Role();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$arrayRecord = array();
|
||||
|
||||
//Create
|
||||
for ($i = 0; $i <= self::$numRole - 1; $i++) {
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_" . $i,
|
||||
"ROL_NAME" => "PHPUnit My Role " . $i
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertTrue(isset($arrayRole["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRole;
|
||||
}
|
||||
|
||||
//Create - Japanese characters
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_" . self::$numRole,
|
||||
"ROL_NAME" => "テスト(PHPUnitの)",
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertTrue(isset($arrayRole["ROL_UID"]));
|
||||
|
||||
$arrayRecord[] = $arrayRole;
|
||||
|
||||
//Return
|
||||
return $arrayRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testUpdate(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array("ROL_NAME" => "PHPUnit My Role ...");
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[1]["ROL_UID"], $arrayData);
|
||||
|
||||
$arrayRole = self::$role->getRole($arrayRecord[1]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], $arrayData["ROL_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::getRoles
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testGetRoles(array $arrayRecord)
|
||||
{
|
||||
$arrayRole = self::$role->getRoles();
|
||||
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$arrayRole = self::$role->getRoles(null, null, null, 0, 0);
|
||||
|
||||
$this->assertEmpty($arrayRole);
|
||||
|
||||
$arrayRole = self::$role->getRoles(array("filter" => "PHPUNIT"));
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole[0]["ROL_UID"], $arrayRecord[0]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole[0]["ROL_CODE"], $arrayRecord[0]["ROL_CODE"]);
|
||||
$this->assertEquals($arrayRole[0]["ROL_NAME"], $arrayRecord[0]["ROL_NAME"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get role
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::getRole
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testGetRole(array $arrayRecord)
|
||||
{
|
||||
//Get
|
||||
$arrayRole = self::$role->getRole($arrayRecord[0]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_UID"], $arrayRecord[0]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole["ROL_CODE"], $arrayRecord[0]["ROL_CODE"]);
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], $arrayRecord[0]["ROL_NAME"]);
|
||||
|
||||
//Get - Japanese characters
|
||||
$arrayRole = self::$role->getRole($arrayRecord[self::$numRole]["ROL_UID"]);
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertNotEmpty($arrayRole);
|
||||
|
||||
$this->assertEquals($arrayRole["ROL_UID"], $arrayRecord[self::$numRole]["ROL_UID"]);
|
||||
$this->assertEquals($arrayRole["ROL_CODE"], "PHPUNIT_MY_ROLE_" . self::$numRole);
|
||||
$this->assertEquals($arrayRole["ROL_NAME"], "テスト(PHPUnitの)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for required data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Undefined value for "ROL_CODE", it is required.
|
||||
*/
|
||||
public function testCreateExceptionRequiredDataRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
//"ROL_CODE" => "PHPUNIT_MY_ROLE_N",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "ROL_CODE", it can not be empty.
|
||||
*/
|
||||
public function testCreateExceptionInvalidDataRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role code existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::create
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role code with ROL_CODE: "PHPUNIT_MY_ROLE_0" already exists.
|
||||
*/
|
||||
public function testCreateExceptionExistsRolCode()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_0",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->create($arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionEmptyData()
|
||||
{
|
||||
$arrayData = array();
|
||||
|
||||
$arrayRole = self::$role->update("", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid role UID
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role with ROL_UID: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx does not exist.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidRolUid()
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "PHPUNIT_MY_ROLE_N",
|
||||
"ROL_NAME" => "PHPUnit My Role N"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->update("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid data (ROL_CODE)
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "ROL_CODE", it can not be empty.
|
||||
*/
|
||||
public function testUpdateExceptionInvalidDataRolCode(array $arrayRecord)
|
||||
{
|
||||
$arrayData = array(
|
||||
"ROL_CODE" => "",
|
||||
"ROL_NAME" => "PHPUnit My Role 0"
|
||||
);
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[0]["ROL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role code existing
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::update
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The role code with ROL_CODE: "PHPUNIT_MY_ROLE_1" already exists.
|
||||
*/
|
||||
public function testUpdateExceptionExistsRolCode(array $arrayRecord)
|
||||
{
|
||||
$arrayData = $arrayRecord[1];
|
||||
|
||||
$arrayRole = self::$role->update($arrayRecord[0]["ROL_UID"], $arrayData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete roles
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::delete
|
||||
*
|
||||
* @depends testCreate
|
||||
* @param array $arrayRecord Data of the roles
|
||||
*/
|
||||
public function testDelete(array $arrayRecord)
|
||||
{
|
||||
foreach ($arrayRecord as $value) {
|
||||
self::$role->delete($value["ROL_UID"]);
|
||||
}
|
||||
|
||||
$arrayRole = self::$role->getRoles(array("filter" => "PHPUNIT"));
|
||||
|
||||
$this->assertTrue(is_array($arrayRole));
|
||||
$this->assertEmpty($arrayRole);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for role UID that cannot be deleted
|
||||
*
|
||||
* @covers \ProcessMaker\BusinessModel\Role::delete
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage This role cannot be deleted while it still has some assigned users.
|
||||
*/
|
||||
public function testDeleteExceptionCannotDeleted()
|
||||
{
|
||||
self::$role->delete("00000000000000000000000000000002");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,315 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnActivity;
|
||||
|
||||
/**
|
||||
* Class BpmnActivityTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnActivityTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"ACT_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "51",
|
||||
"BOU_Y" => "52"
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"ACT_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => "53",
|
||||
"BOU_Y" => "54"
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$activities = BpmnActivity::findAllBy(BpmnActivityPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($activities as $activity) {
|
||||
$activity->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$activity = new BpmnActivity();
|
||||
$activity->setActUid(self::$data1["ACT_UID"]);
|
||||
$activity->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$activity->setProUid(self::$data1["PRO_UID"]);
|
||||
$activity->setActName(self::$data1["ACT_NAME"]);
|
||||
$activity->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$activity->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$activity->save();
|
||||
|
||||
$activity2 = BpmnActivityPeer::retrieveByPK($activity->getActUid());
|
||||
|
||||
$this->assertNotNull($activity2);
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$activity = new BpmnActivity();
|
||||
$activity->fromArray(self::$data2);
|
||||
|
||||
$activity->save();
|
||||
|
||||
$activity2 = BpmnActivityPeer::retrieveByPK($activity->getActUid());
|
||||
|
||||
$this->assertNotNull($activity2);
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $activity \BpmnActivity
|
||||
*/
|
||||
public function testToArrayFromTestNew($activity)
|
||||
{
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data1["ACT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"ACT_NAME" => self::$data1["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($activity)
|
||||
{
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data2["ACT_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"ACT_NAME" => self::$data2["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => "18171550f1198ddc8642045664020352",
|
||||
"ELEMENT_UID" => self::$data2["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$activity = BpmnActivityPeer::retrieveByPK(self::$data1["ACT_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"ACT_UID" => self::$data1["ACT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"ACT_NAME" => self::$data1["ACT_NAME"],
|
||||
"ACT_TYPE" => "TASK",
|
||||
"ACT_IS_FOR_COMPENSATION" => "0",
|
||||
"ACT_START_QUANTITY" => "1",
|
||||
"ACT_COMPLETION_QUANTITY" => "1",
|
||||
"ACT_TASK_TYPE" => "EMPTY",
|
||||
"ACT_IMPLEMENTATION" => "",
|
||||
"ACT_INSTANTIATE" => "0",
|
||||
"ACT_SCRIPT_TYPE" => "",
|
||||
"ACT_SCRIPT" => "",
|
||||
"ACT_LOOP_TYPE" => "NONE",
|
||||
"ACT_TEST_BEFORE" => "0",
|
||||
"ACT_LOOP_MAXIMUM" => "0",
|
||||
"ACT_LOOP_CONDITION" => "",
|
||||
"ACT_LOOP_CARDINALITY" => "0",
|
||||
"ACT_LOOP_BEHAVIOR" => "NONE",
|
||||
"ACT_IS_ADHOC" => "0",
|
||||
"ACT_IS_COLLAPSED" => "1",
|
||||
"ACT_COMPLETION_CONDITION" => "",
|
||||
"ACT_ORDERING" => "PARALLEL",
|
||||
"ACT_CANCEL_REMAINING_INSTANCES" => "1",
|
||||
"ACT_PROTOCOL" => "",
|
||||
"ACT_METHOD" => "",
|
||||
"ACT_IS_GLOBAL" => "0",
|
||||
"ACT_REFERER" => "",
|
||||
"ACT_DEFAULT_FLOW" => "",
|
||||
"ACT_MASTER_DIAGRAM" => "",
|
||||
"DIA_UID" => "18171550f1198ddc8642045664020352",
|
||||
"ELEMENT_UID" => self::$data1["ACT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnActivity",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => "0",
|
||||
"BOU_HEIGHT" => "0",
|
||||
"BOU_REL_POSITION" => "0",
|
||||
"BOU_SIZE_IDENTICAL" => "0",
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $activity->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $activity1 \BpmnActivity
|
||||
* @param $activity2 \BpmnActivity
|
||||
*/
|
||||
public function testDelete($activity1, $activity2)
|
||||
{
|
||||
$actUid = $activity1->getActUid();
|
||||
$activity = BpmnActivityPeer::retrieveByPK($actUid);
|
||||
$activity->delete();
|
||||
|
||||
$this->assertNull(BpmnActivityPeer::retrieveByPK($actUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Activity", $actUid));
|
||||
|
||||
|
||||
$actUid = $activity2->getActUid();
|
||||
$activity = BpmnActivityPeer::retrieveByPK($actUid);
|
||||
$activity->delete();
|
||||
|
||||
$this->assertNull(BpmnActivityPeer::retrieveByPK($actUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Activity", $actUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,297 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnEvent;
|
||||
|
||||
/**
|
||||
* Class BpmnEventTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnEventTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"EVN_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "START",
|
||||
"BOU_X" => 51,
|
||||
"BOU_Y" => 52
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"EVN_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"EVN_NAME" => "Event #2",
|
||||
"EVN_TYPE" => "END",
|
||||
"BOU_X" => 53,
|
||||
"BOU_Y" => 54
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$events = BpmnEvent::findAllBy(BpmnEventPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($events as $event) {
|
||||
$event->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$event = new BpmnEvent();
|
||||
$event->setEvnUid(self::$data1["EVN_UID"]);
|
||||
$event->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$event->setProUid(self::$data1["PRO_UID"]);
|
||||
$event->setEvnName(self::$data1["EVN_NAME"]);
|
||||
$event->setEvnType(self::$data1["EVN_TYPE"]);
|
||||
$event->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$event->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$event->save();
|
||||
|
||||
$event2 = BpmnEventPeer::retrieveByPK($event->getEvnUid());
|
||||
|
||||
$this->assertNotNull($event2);
|
||||
|
||||
return $event;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$event = new BpmnEvent();
|
||||
$event->fromArray(self::$data2);
|
||||
$event->save();
|
||||
|
||||
$event2 = BpmnEventPeer::retrieveByPK($event->getEvnUid());
|
||||
|
||||
$this->assertNotNull($event2);
|
||||
|
||||
return $event;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $event \BpmnEvent
|
||||
*/
|
||||
public function testToArrayFromTestNew($event)
|
||||
{
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data1["EVN_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"EVN_NAME" => self::$data1["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data1["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $event \BpmnEvent
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($event)
|
||||
{
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data2["EVN_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"EVN_NAME" => self::$data2["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data2["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data2["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$event = BpmnEventPeer::retrieveByPK(self::$data1["EVN_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"EVN_UID" => self::$data1["EVN_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"EVN_NAME" => self::$data1["EVN_NAME"],
|
||||
"EVN_TYPE" => self::$data1["EVN_TYPE"],
|
||||
"EVN_MARKER" => "EMPTY",
|
||||
"EVN_IS_INTERRUPTING" => 1,
|
||||
"EVN_ATTACHED_TO" => "",
|
||||
"EVN_CANCEL_ACTIVITY" => 0,
|
||||
"EVN_ACTIVITY_REF" => "",
|
||||
"EVN_WAIT_FOR_COMPLETION" => 1,
|
||||
"EVN_ERROR_NAME" => null,
|
||||
"EVN_ERROR_CODE" => null,
|
||||
"EVN_ESCALATION_NAME" => null,
|
||||
"EVN_ESCALATION_CODE" => null,
|
||||
"EVN_CONDITION" => null,
|
||||
"EVN_MESSAGE" => null,
|
||||
"EVN_OPERATION_NAME" => null,
|
||||
"EVN_OPERATION_IMPLEMENTATION_REF" => null,
|
||||
"EVN_TIME_DATE" => null,
|
||||
"EVN_TIME_CYCLE" => null,
|
||||
"EVN_TIME_DURATION" => null,
|
||||
"EVN_BEHAVIOR" => "CATCH",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["EVN_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnEvent",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $event->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $event1 \BpmnEvent
|
||||
* @param $event2 \BpmnEvent
|
||||
*/
|
||||
public function testDelete($event1, $event2)
|
||||
{
|
||||
$gatUid = $event1->getEvnUid();
|
||||
$event = BpmnEventPeer::retrieveByPK($gatUid);
|
||||
$event->delete();
|
||||
|
||||
$this->assertNull(BpmnEventPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Event", $gatUid));
|
||||
|
||||
|
||||
$gatUid = $event2->getEvnUid();
|
||||
$event = BpmnEventPeer::retrieveByPK($gatUid);
|
||||
$event->delete();
|
||||
|
||||
$this->assertNull(BpmnEventPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Event", $gatUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,262 +0,0 @@
|
||||
<?php
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../bootstrap.php";
|
||||
}
|
||||
|
||||
use \BpmnGateway;
|
||||
|
||||
|
||||
/**
|
||||
* Class BpmnGatewayTest
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnGatewayTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUid = "00000000000000000000000000000001";
|
||||
protected static $diaUid = "18171550f1198ddc8642045664020352";
|
||||
protected static $proUid = "155064020352f1198ddc864204561817";
|
||||
|
||||
protected static $data1;
|
||||
protected static $data2;
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$project = new \BpmnProject();
|
||||
$project->setPrjUid(self::$prjUid);
|
||||
$project->setPrjName("Dummy Project");
|
||||
$project->save();
|
||||
|
||||
$process = new \BpmnDiagram();
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->save();
|
||||
|
||||
$process = new \BpmnProcess();
|
||||
$process->setProUid(self::$proUid);
|
||||
$process->setPrjUid(self::$prjUid);
|
||||
$process->setDiaUid(self::$diaUid);
|
||||
$process->save();
|
||||
|
||||
self::$data1 = array(
|
||||
"GAT_UID" => "864215906402045618170352f1198ddc",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "SELECTION",
|
||||
"BOU_X" => 51,
|
||||
"BOU_Y" => 52
|
||||
);
|
||||
|
||||
self::$data2 = array(
|
||||
"GAT_UID" => "70352f1198ddc8642159064020456181",
|
||||
"PRJ_UID" => self::$prjUid,
|
||||
"PRO_UID" => self::$proUid,
|
||||
"GAT_NAME" => "Gateway #2",
|
||||
"GAT_TYPE" => "EVALUATION",
|
||||
"BOU_X" => 53,
|
||||
"BOU_Y" => 54
|
||||
);
|
||||
}
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$gateways = BpmnGateway::findAllBy(BpmnGatewayPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($gateways as $gateway) {
|
||||
$gateway->delete();
|
||||
}
|
||||
|
||||
$bounds = BpmnBound::findAllBy(BpmnBoundPeer::PRJ_UID, self::$prjUid);
|
||||
foreach ($bounds as $bound) {
|
||||
$bound->delete();
|
||||
}
|
||||
|
||||
$process = BpmnProcessPeer::retrieveByPK(self::$proUid);
|
||||
$process->delete();
|
||||
|
||||
$diagram = BpmnDiagramPeer::retrieveByPK(self::$diaUid);
|
||||
$diagram->delete();
|
||||
|
||||
$project = BpmnProjectPeer::retrieveByPK(self::$prjUid);
|
||||
$project->delete();
|
||||
}
|
||||
|
||||
public function testNew()
|
||||
{
|
||||
$gateway = new BpmnGateway();
|
||||
$gateway->setGatUid(self::$data1["GAT_UID"]);
|
||||
$gateway->setPrjUid(self::$data1["PRJ_UID"]);
|
||||
$gateway->setProUid(self::$data1["PRO_UID"]);
|
||||
$gateway->setGatName(self::$data1["GAT_NAME"]);
|
||||
$gateway->setGatType(self::$data1["GAT_TYPE"]);
|
||||
$gateway->getBound()->setBouX(self::$data1["BOU_X"]);
|
||||
$gateway->getBound()->setBouY(self::$data1["BOU_Y"]);
|
||||
$gateway->save();
|
||||
|
||||
$gateway2 = BpmnGatewayPeer::retrieveByPK($gateway->getGatUid());
|
||||
|
||||
$this->assertNotNull($gateway2);
|
||||
|
||||
return $gateway;
|
||||
}
|
||||
|
||||
public function testNewUsingFromArray()
|
||||
{
|
||||
$gateway = new BpmnGateway();
|
||||
$gateway->fromArray(self::$data2);
|
||||
$gateway->save();
|
||||
|
||||
$gateway2 = BpmnGatewayPeer::retrieveByPK($gateway->getGatUid());
|
||||
|
||||
$this->assertNotNull($gateway2);
|
||||
|
||||
return $gateway;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param $gateway \BpmnGateway
|
||||
*/
|
||||
public function testToArrayFromTestNew($gateway)
|
||||
{
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data1["GAT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"GAT_NAME" => self::$data1["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data1["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $gateway \BpmnGateway
|
||||
*/
|
||||
public function testToArrayFromTestNewUsingFromArray($gateway)
|
||||
{
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data2["GAT_UID"],
|
||||
"PRJ_UID" => self::$data2["PRJ_UID"],
|
||||
"PRO_UID" => self::$data2["PRO_UID"],
|
||||
"GAT_NAME" => self::$data2["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data2["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data2["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data2["BOU_X"],
|
||||
"BOU_Y" => self::$data2["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
$bouUid = $result["BOU_UID"];
|
||||
|
||||
$this->assertNotEmpty($bouUid);
|
||||
$this->assertEquals(32, strlen($bouUid));
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function testToArray()
|
||||
{
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK(self::$data1["GAT_UID"]);
|
||||
|
||||
$expected = array(
|
||||
"GAT_UID" => self::$data1["GAT_UID"],
|
||||
"PRJ_UID" => self::$data1["PRJ_UID"],
|
||||
"PRO_UID" => self::$data1["PRO_UID"],
|
||||
"GAT_NAME" => self::$data1["GAT_NAME"],
|
||||
"GAT_TYPE" => self::$data1["GAT_TYPE"],
|
||||
"GAT_DIRECTION" => "UNSPECIFIED",
|
||||
"GAT_INSTANTIATE" => 0,
|
||||
"GAT_EVENT_GATEWAY_TYPE" => 'NONE',
|
||||
"GAT_ACTIVATION_COUNT" => 0,
|
||||
"GAT_WAITING_FOR_START" => 1,
|
||||
"GAT_DEFAULT_FLOW" => "",
|
||||
"DIA_UID" => self::$diaUid,
|
||||
"ELEMENT_UID" => self::$data1["GAT_UID"],
|
||||
"BOU_ELEMENT" => "pm_canvas",
|
||||
"BOU_ELEMENT_TYPE" => "bpmnGateway",
|
||||
"BOU_X" => self::$data1["BOU_X"],
|
||||
"BOU_Y" => self::$data1["BOU_Y"],
|
||||
"BOU_WIDTH" => 0,
|
||||
"BOU_HEIGHT" => 0,
|
||||
"BOU_REL_POSITION" => 0,
|
||||
"BOU_SIZE_IDENTICAL" => 0,
|
||||
"BOU_CONTAINER" => "bpmnDiagram"
|
||||
);
|
||||
|
||||
$result = $gateway->toArray();
|
||||
|
||||
unset($result["BOU_UID"]);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testNewUsingFromArray
|
||||
* @param $gateway1 \BpmnGateway
|
||||
* @param $gateway2 \BpmnGateway
|
||||
*/
|
||||
public function testDelete($gateway1, $gateway2)
|
||||
{
|
||||
$gatUid = $gateway1->getGatUid();
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK($gatUid);
|
||||
$gateway->delete();
|
||||
|
||||
$this->assertNull(BpmnGatewayPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Gateway", $gatUid));
|
||||
|
||||
|
||||
$gatUid = $gateway2->getGatUid();
|
||||
$gateway = BpmnGatewayPeer::retrieveByPK($gatUid);
|
||||
$gateway->delete();
|
||||
|
||||
$this->assertNull(BpmnGatewayPeer::retrieveByPK($gatUid));
|
||||
// the previous call must delete the bound object related to activity too.
|
||||
$this->assertNull(BpmnBound::findByElement("Gateway", $gatUid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Exporter;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlExporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class XmlExporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $exporter;
|
||||
protected static $projectUid = "";
|
||||
protected static $filePmx = "";
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$json = "
|
||||
{
|
||||
\"prj_name\": \"" . \ProcessMaker\Util\Common::generateUID() . "\",
|
||||
\"prj_author\": \"00000000000000000000000000000001\",
|
||||
\"diagrams\": [
|
||||
{
|
||||
\"dia_uid\": \"\",
|
||||
\"activities\": [],
|
||||
\"events\": [],
|
||||
\"gateways\": [],
|
||||
\"flows\": [],
|
||||
\"artifacts\": [],
|
||||
\"laneset\": [],
|
||||
\"lanes\": []
|
||||
}
|
||||
]
|
||||
}
|
||||
";
|
||||
|
||||
$arrayResult = \ProcessMaker\Project\Adapter\BpmnWorkflow::createFromStruct(json_decode($json, true));
|
||||
|
||||
self::$projectUid = $arrayResult[0]["new_uid"];
|
||||
self::$filePmx = PATH_DOCUMENT . "output" . PATH_SEP . self::$projectUid . ".pmx";
|
||||
|
||||
self::$exporter = new \ProcessMaker\Exporter\XmlExporter(self::$projectUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete project
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load(self::$projectUid);
|
||||
$bpmnWf->remove();
|
||||
|
||||
unlink(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test export
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::export
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function testExport()
|
||||
{
|
||||
$strXml = self::$exporter->export();
|
||||
|
||||
$this->assertTrue(is_string($strXml));
|
||||
$this->assertNotEmpty($strXml);
|
||||
|
||||
return $strXml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test build
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::build
|
||||
*
|
||||
* @depends testExport
|
||||
* @param string $strXml Data xml
|
||||
*/
|
||||
public function testBuild($strXml)
|
||||
{
|
||||
//DOMDocument
|
||||
$doc = new \DOMDocument();
|
||||
$doc->loadXML($strXml);
|
||||
|
||||
$nodeRoot = $doc->getElementsByTagName("ProcessMaker-Project")->item(0);
|
||||
$uid = "";
|
||||
|
||||
//Node meta
|
||||
$nodeMeta = $nodeRoot->getElementsByTagName("metadata")->item(0)->getElementsByTagName("meta");
|
||||
|
||||
$this->assertNotEmpty($nodeMeta);
|
||||
|
||||
foreach ($nodeMeta as $value) {
|
||||
$node = $value;
|
||||
|
||||
if ($node->hasAttribute("key") && $node->getAttribute("key") == "uid") {
|
||||
$uid = $node->nodeValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->assertEquals(self::$projectUid, $uid);
|
||||
|
||||
//Node definition
|
||||
$nodeDefinition = $nodeRoot->getElementsByTagName("definition");
|
||||
|
||||
$this->assertNotEmpty($nodeDefinition);
|
||||
|
||||
foreach ($nodeDefinition as $value) {
|
||||
$node = $value;
|
||||
|
||||
if ($node->hasAttribute("class")) {
|
||||
$this->assertContains($node->getAttribute("class"), array("BPMN", "workflow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test saveExport
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::saveExport
|
||||
*/
|
||||
public function testSaveExport()
|
||||
{
|
||||
self::$exporter->saveExport(self::$filePmx);
|
||||
|
||||
$this->assertTrue(file_exists(self::$filePmx));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getTextNode
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::getTextNode
|
||||
*/
|
||||
public function testGetTextNode()
|
||||
{
|
||||
//Is not implemented. Method getTextNode() is private
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid project uid
|
||||
*
|
||||
* @covers \ProcessMaker\Exporter\XmlExporter::__construct
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project "ProcessMaker\Project\Bpmn" with UID: 0, does not exist.
|
||||
*/
|
||||
public function test__constructExceptionInvalidProjectUid()
|
||||
{
|
||||
$exporter = new \ProcessMaker\Exporter\XmlExporter("0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Importer;
|
||||
|
||||
if (!class_exists("Propel")) {
|
||||
include_once(__DIR__ . "/../../bootstrap.php");
|
||||
}
|
||||
|
||||
/**
|
||||
* Class XmlImporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
*/
|
||||
class XmlImporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $importer;
|
||||
protected static $projectUid = "";
|
||||
protected static $filePmx = "";
|
||||
|
||||
protected static $arrayPrjUid = array();
|
||||
|
||||
/**
|
||||
* Set class for test
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
$json = "
|
||||
{
|
||||
\"prj_name\": \"" . \ProcessMaker\Util\Common::generateUID() . "\",
|
||||
\"prj_author\": \"00000000000000000000000000000001\",
|
||||
\"diagrams\": [
|
||||
{
|
||||
\"dia_uid\": \"\",
|
||||
\"activities\": [],
|
||||
\"events\": [],
|
||||
\"gateways\": [],
|
||||
\"flows\": [],
|
||||
\"artifacts\": [],
|
||||
\"laneset\": [],
|
||||
\"lanes\": []
|
||||
}
|
||||
]
|
||||
}
|
||||
";
|
||||
|
||||
$arrayResult = \ProcessMaker\Project\Adapter\BpmnWorkflow::createFromStruct(json_decode($json, true));
|
||||
|
||||
self::$projectUid = $arrayResult[0]["new_uid"];
|
||||
self::$filePmx = PATH_DOCUMENT . "input" . PATH_SEP . self::$projectUid . ".pmx";
|
||||
|
||||
$exporter = new \ProcessMaker\Exporter\XmlExporter(self::$projectUid);
|
||||
$exporter->saveExport(self::$filePmx);
|
||||
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load(self::$projectUid);
|
||||
$bpmnWf->remove();
|
||||
|
||||
self::$importer = new \ProcessMaker\Importer\XmlImporter();
|
||||
self::$importer->setSourceFile(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete projects
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
foreach (self::$arrayPrjUid as $value) {
|
||||
$prjUid = $value;
|
||||
|
||||
$bpmnWf = \ProcessMaker\Project\Adapter\BpmnWorkflow::load($prjUid);
|
||||
$bpmnWf->remove();
|
||||
}
|
||||
|
||||
unlink(self::$filePmx);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test load
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::load
|
||||
*/
|
||||
public function testLoad()
|
||||
{
|
||||
$arrayData = self::$importer->load();
|
||||
|
||||
$this->assertTrue(is_array($arrayData));
|
||||
$this->assertNotEmpty($arrayData);
|
||||
|
||||
$this->assertArrayHasKey("tables", $arrayData);
|
||||
$this->assertArrayHasKey("files", $arrayData);
|
||||
|
||||
$this->assertEquals($arrayData["tables"]["bpmn"]["project"][0]["prj_uid"], self::$projectUid);
|
||||
$this->assertEquals($arrayData["tables"]["workflow"]["process"][0]["PRO_UID"], self::$projectUid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test getTextNode
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::getTextNode
|
||||
*/
|
||||
public function testGetTextNode()
|
||||
{
|
||||
//Is not implemented. Method getTextNode() is private
|
||||
}
|
||||
|
||||
/**
|
||||
* Test import
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::import
|
||||
*/
|
||||
public function testImport()
|
||||
{
|
||||
$prjUid = self::$importer->import();
|
||||
self::$arrayPrjUid[] = $prjUid;
|
||||
|
||||
$this->assertNotNull(\BpmnProjectPeer::retrieveByPK($prjUid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test importPostFile
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*/
|
||||
public function testImportPostFile()
|
||||
{
|
||||
self::$importer->setSaveDir(PATH_DOCUMENT . "input");
|
||||
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => self::$projectUid . ".pmx"), "KEEP");
|
||||
self::$arrayPrjUid[] = $arrayData["PRJ_UID"];
|
||||
|
||||
$this->assertNotNull(\BpmnProjectPeer::retrieveByPK($arrayData["PRJ_UID"]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when the project exists
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::import
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project already exists, you need set an action to continue. Available actions: [project.import.create_new|project.import.override|project.import.disable_and_create_new|project.import.keep_without_changing_and_create_new].
|
||||
*/
|
||||
public function testImportExceptionProjectExists()
|
||||
{
|
||||
$prjUid = self::$importer->import();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for empty data
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "$arrayData", it can not be empty.
|
||||
*/
|
||||
public function testImportPostFileExceptionEmptyData()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid extension
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The file extension not is "pmx"
|
||||
*/
|
||||
public function testImportPostFileExceptionInvalidExtension()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pm"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for file does not exist
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage The file with PROJECT_FILE: "file.pmx" does not exist.
|
||||
*/
|
||||
public function testImportPostFileExceptionFileNotExists()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pmx"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception for invalid option
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Invalid value for "OPTION", it only accepts values: "CREATE|OVERWRITE|DISABLE|KEEP".
|
||||
*/
|
||||
public function testImportPostFileExceptionInvalidOption()
|
||||
{
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => "file.pmx"), "CREATED");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exception when the project exists
|
||||
*
|
||||
* @covers \ProcessMaker\Importer\XmlImporter::importPostFile
|
||||
*
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Project already exists, you need set an action to continue. Available actions: [CREATE|OVERWRITE|DISABLE|KEEP].
|
||||
*/
|
||||
public function testImportPostFileExceptionProjectExists()
|
||||
{
|
||||
self::$importer->setSaveDir(PATH_DOCUMENT . "input");
|
||||
|
||||
$arrayData = self::$importer->importPostFile(array("PROJECT_FILE" => self::$projectUid . ".pmx"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,713 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project\Adapter;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
use \ProcessMaker\Exception;
|
||||
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class BpmnWorkflowTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project\Adapter
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnWorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $uids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//return false;
|
||||
//cleaning DB
|
||||
foreach (self::$uids as $prjUid) {
|
||||
$bwap = Project\Adapter\BpmnWorkflow::load($prjUid);
|
||||
$bwap->remove();
|
||||
}
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test Bpmn/Workflow Project #1.". rand(1, 100),
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1." . rand(1, 100),
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$bwap = new Project\Adapter\BpmnWorkflow($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$bp = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$wp = null;
|
||||
}
|
||||
|
||||
self::$uids[] = $bwap->getUid();
|
||||
|
||||
$this->assertNotNull($bp);
|
||||
$this->assertNotNull($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
|
||||
return $bwap;
|
||||
}
|
||||
|
||||
function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test Bpmn/Workflow Project #2",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #2",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$bwap = new Project\Adapter\BpmnWorkflow();
|
||||
$bwap->create($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$bp = null;
|
||||
}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
} catch (\Exception $e){
|
||||
$wp = null;
|
||||
}
|
||||
|
||||
$this->assertNotEmpty($bp);
|
||||
$this->assertNotEmpty($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
|
||||
return $bwap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testRemove(Project\Adapter\BpmnWorkflow $bwap)
|
||||
{
|
||||
$prjUid = $bwap->getUid();
|
||||
$bwap->remove();
|
||||
$bp = $wp = null;
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($prjUid);
|
||||
} catch (Exception\ProjectNotFound $e) {}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($prjUid);
|
||||
} catch (Exception\ProjectNotFound $e) {}
|
||||
|
||||
$this->assertNull($bp);
|
||||
$this->assertNull($wp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Testing Project's Activity
|
||||
*/
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testAddActivity($bwap)
|
||||
{
|
||||
// before add activity, we need to add a diagram and process to the project
|
||||
$bwap->addDiagram();
|
||||
$bwap->addProcess();
|
||||
|
||||
// add the new activity
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertEquals($activity["ACT_NAME"], $task["TAS_TITLE"]);
|
||||
$this->assertEquals($activity["BOU_X"], $task["TAS_POSX"]);
|
||||
$this->assertEquals($activity["BOU_Y"], $task["TAS_POSY"]);
|
||||
|
||||
return $actUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivity
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $actUid
|
||||
*/
|
||||
function testUpdateActivity($bwap, $actUid)
|
||||
{
|
||||
$updatedData = array(
|
||||
"ACT_NAME" => "Activity #1 - (Modified)",
|
||||
"BOU_X" => 122,
|
||||
"BOU_Y" => 250
|
||||
);
|
||||
|
||||
$bwap->updateActivity($actUid, $updatedData);
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertEquals($activity["ACT_NAME"], $task["TAS_TITLE"]);
|
||||
$this->assertEquals($activity["BOU_X"], $task["TAS_POSX"]);
|
||||
$this->assertEquals($activity["BOU_Y"], $task["TAS_POSY"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivity
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $actUid
|
||||
*/
|
||||
function testRemoveActivity($bwap, $actUid)
|
||||
{
|
||||
$bwap->removeActivity($actUid);
|
||||
$activity = $bwap->getActivity($actUid);
|
||||
|
||||
$this->assertNull($activity);
|
||||
}
|
||||
|
||||
/*
|
||||
* Testing Project's Flows
|
||||
*/
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testAddActivityToActivityFlow($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 122,
|
||||
"BOU_Y" => 222
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 322,
|
||||
"BOU_Y" => 422
|
||||
));
|
||||
|
||||
$flowData = array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 326,
|
||||
'FLO_Y1' => 146,
|
||||
'FLO_X2' => 461,
|
||||
'FLO_Y2' => 146,
|
||||
);
|
||||
|
||||
$flowUid = $bwap->addFlow($flowData);
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $actUid1,
|
||||
\RoutePeer::ROU_NEXT_TASK => $actUid2
|
||||
));
|
||||
|
||||
$this->assertNotNull($route);
|
||||
$this->assertTrue(is_string($flowUid));
|
||||
$this->assertEquals(32, strlen($flowUid));
|
||||
$this->assertEquals($route->getRouNextTask(), $actUid2);
|
||||
$this->assertEquals($route->getRouType(), "SEQUENTIAL");
|
||||
|
||||
return array("flow_uid" => $flowUid, "activitiesUid" => array($actUid1, $actUid2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testAddActivityToActivityFlow
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param array $input
|
||||
*/
|
||||
function testRemoveActivityToActivityFlow($bwap, $input)
|
||||
{
|
||||
$bwap->removeFlow($input["flow_uid"]);
|
||||
$this->assertNull($bwap->getFlow($input["flow_uid"]));
|
||||
|
||||
$route = \Route::findOneBy(array(
|
||||
\RoutePeer::TAS_UID => $input["activitiesUid"][0],
|
||||
\RoutePeer::ROU_NEXT_TASK => $input["activitiesUid"][1]
|
||||
));
|
||||
|
||||
$this->assertNull($route);
|
||||
|
||||
// cleaning
|
||||
$bwap->removeActivity($input["activitiesUid"][0]);
|
||||
$bwap->removeActivity($input["activitiesUid"][1]);
|
||||
|
||||
$this->assertCount(0, $bwap->getActivities());
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsSingle($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 56
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 198,
|
||||
"BOU_Y" => 250
|
||||
));
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "DIVERGING",
|
||||
"BOU_X" => 256,
|
||||
"BOU_Y" => 163
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 163,
|
||||
'FLO_Y2' => 163,
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 249,
|
||||
'FLO_Y2' => 249,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(2, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getGateways());
|
||||
$this->assertCount(2, $bwap->getFlows());
|
||||
|
||||
$flows1 = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
|
||||
$flows2 = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
|
||||
|
||||
$this->assertCount(1, $flows1);
|
||||
$this->assertCount(1, $flows2);
|
||||
$this->assertEquals($flows1[0]->getFloElementOrigin(), $actUid1);
|
||||
$this->assertEquals($flows2[0]->getFloElementDest(), $actUid2);
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultiple($bwap)
|
||||
{
|
||||
$actUid1 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 311,
|
||||
"BOU_Y" => 26
|
||||
));
|
||||
$actUid2 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => 99,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid3 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #3",
|
||||
"BOU_X" => 310,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$actUid4 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #4",
|
||||
"BOU_X" => 542,
|
||||
"BOU_Y" => 200
|
||||
));
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #1",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "DIVERGING",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 123
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid1,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid2,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 273,
|
||||
'FLO_Y1' => 273,
|
||||
'FLO_X2' => 249,
|
||||
'FLO_Y2' => 249,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid3,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 174,
|
||||
'FLO_X2' => 206,
|
||||
'FLO_Y2' => 206,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid4,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 386,
|
||||
'FLO_Y1' => 617,
|
||||
'FLO_X2' => 207,
|
||||
'FLO_Y2' => 207,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(4, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getGateways());
|
||||
$this->assertCount(4, $bwap->getFlows());
|
||||
$this->assertCount(1, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid));
|
||||
$this->assertCount(3, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(4, $wp->getTasks());
|
||||
$this->assertCount(3, $wp->getRoutes());
|
||||
$this->assertCount(3, \Route::findAllBy(\RoutePeer::TAS_UID, $actUid1));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid2));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid3));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid4));
|
||||
|
||||
return array($actUid2, $actUid3, $actUid4);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testActivityToInclusiveGatewayToActivityFlowsMultiple
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param array $activitiesUid
|
||||
*/
|
||||
function testActivityToInclusiveGatewayToActivityFlowsMultipleJoin($bwap, $activitiesUid)
|
||||
{
|
||||
$gatUid = $bwap->addGateway(array(
|
||||
"GAT_NAME" => "Gateway #2",
|
||||
"GAT_TYPE" => "INCLUSIVE",
|
||||
"GAT_DIRECTION" => "CONVERGING",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338
|
||||
));
|
||||
$actUid5 = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #5",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[0],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[1],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 385,
|
||||
'FLO_Y1' => 382,
|
||||
'FLO_X2' => 338,
|
||||
'FLO_Y2' => 338,
|
||||
));
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $activitiesUid[2],
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $gatUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnGateway',
|
||||
'FLO_X1' => 617,
|
||||
'FLO_Y1' => 398,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $gatUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnGateway',
|
||||
'FLO_ELEMENT_DEST' => $actUid5,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 382,
|
||||
'FLO_Y1' => 387,
|
||||
'FLO_X2' => 463,
|
||||
'FLO_Y2' => 463,
|
||||
));
|
||||
|
||||
$bwap->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
$this->assertCount(8, $bwap->getFlows());
|
||||
$this->assertCount(5, $bwap->getActivities());
|
||||
$this->assertCount(2, $bwap->getGateways());
|
||||
$this->assertCount(3, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid));
|
||||
$this->assertCount(1, \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid));
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(5, $wp->getTasks());
|
||||
$this->assertCount(6, $wp->getRoutes());
|
||||
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[0]));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[1]));
|
||||
$this->assertCount(1, \Route::findAllBy(\RoutePeer::TAS_UID, $activitiesUid[2]));
|
||||
$this->assertCount(3, \Route::findAllBy(\RoutePeer::ROU_NEXT_TASK, $actUid5));
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @return string
|
||||
*/
|
||||
function testSetStartEvent($bwap)
|
||||
{
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$evnUid = $bwap->addEvent(array(
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "START",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338,
|
||||
"EVN_MARKER" => "MESSAGE",
|
||||
"EVN_MESSAGE" => "LEAD"
|
||||
));
|
||||
$floUid = $bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $evnUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnEvent',
|
||||
'FLO_ELEMENT_DEST' => $actUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnActivity',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(1, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
$this->assertNotNull($task);
|
||||
|
||||
$this->assertEquals($task["TAS_START"], "TRUE");
|
||||
|
||||
return $floUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testSetStartEvent
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param string $floUid
|
||||
*/
|
||||
function testUnsetStartEvent($bwap, $floUid)
|
||||
{
|
||||
$bwap->removeFlow($floUid);
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertCount(1, $tasks);
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
$this->assertEquals($tasks[0]["TAS_START"], "FALSE");
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
function testSetEndEvent($bwap)
|
||||
{
|
||||
$actUid = $bwap->addActivity(array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => 312,
|
||||
"BOU_Y" => 464
|
||||
));
|
||||
$evnUid = $bwap->addEvent(array(
|
||||
"EVN_NAME" => "Event #1",
|
||||
"EVN_TYPE" => "END",
|
||||
"BOU_X" => 369,
|
||||
"BOU_Y" => 338,
|
||||
"EVN_MARKER" => "MESSAGE",
|
||||
"EVN_MESSAGE" => "LEAD"
|
||||
));
|
||||
$floUid = $bwap->addFlow(array(
|
||||
'FLO_TYPE' => 'SEQUENCE',
|
||||
'FLO_ELEMENT_ORIGIN' => $actUid,
|
||||
'FLO_ELEMENT_ORIGIN_TYPE' => 'bpmnActivity',
|
||||
'FLO_ELEMENT_DEST' => $evnUid,
|
||||
'FLO_ELEMENT_DEST_TYPE' => 'bpmnEvent',
|
||||
'FLO_X1' => 174,
|
||||
'FLO_Y1' => 365,
|
||||
'FLO_X2' => 355,
|
||||
'FLO_Y2' => 355,
|
||||
));
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(1, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
$task = $wp->getTask($actUid);
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(1, $wp->getRoutes());
|
||||
$this->assertNotNull($task);
|
||||
|
||||
$routes = \Route::findAllBy(\RoutePeer::TAS_UID, $task["TAS_UID"]);
|
||||
|
||||
$this->assertCount(1, $routes);
|
||||
$this->assertEquals($routes[0]->getRouNextTask(), "-1");
|
||||
|
||||
return $floUid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testNew
|
||||
* @depends testSetEndEvent
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
* @param $floUid
|
||||
*/
|
||||
function testUnsetEndEvent($bwap, $floUid)
|
||||
{
|
||||
$bwap->removeFlow($floUid);
|
||||
|
||||
$this->assertCount(1, $bwap->getActivities());
|
||||
$this->assertCount(1, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(1, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
|
||||
// cleaning
|
||||
$this->resetProject($bwap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \ProcessMaker\Project\Adapter\BpmnWorkflow $bwap
|
||||
*/
|
||||
protected function resetProject(\ProcessMaker\Project\Adapter\BpmnWorkflow $bwap)
|
||||
{
|
||||
// cleaning
|
||||
$activities = $bwap->getActivities();
|
||||
foreach ($activities as $activity) {
|
||||
$bwap->removeActivity($activity["ACT_UID"]);
|
||||
}
|
||||
$events = $bwap->getEvents();
|
||||
foreach ($events as $event) {
|
||||
$bwap->removeEvent($event["EVN_UID"]);
|
||||
}
|
||||
$gateways = $bwap->getGateways();
|
||||
foreach ($gateways as $gateway) {
|
||||
$bwap->removeGateway($gateway["GAT_UID"]);
|
||||
}
|
||||
$flows = $bwap->getFlows();
|
||||
foreach ($flows as $flow) {
|
||||
$bwap->removeFlow($flow["FLO_UID"]);
|
||||
}
|
||||
|
||||
// verifying that project is cleaned
|
||||
$this->assertCount(0, $bwap->getActivities());
|
||||
$this->assertCount(0, $bwap->getEvents());
|
||||
$this->assertCount(0, $bwap->getGateways());
|
||||
$this->assertCount(0, $bwap->getFlows());
|
||||
|
||||
$wp = Project\Workflow::load($bwap->getUid());
|
||||
|
||||
$this->assertCount(0, $wp->getTasks());
|
||||
$this->assertCount(0, $wp->getRoutes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project\Adapter;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class WorkflowBpmnTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project\Adapter
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class WorkflowBpmnTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $uids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//cleaning DB
|
||||
foreach (self::$uids as $prjUid) {
|
||||
$wbpa = Project\Adapter\WorkflowBpmn::load($prjUid);
|
||||
$wbpa->remove();
|
||||
}
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Workflow/Bpmn Project #1",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #1",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$wbap = new Project\Adapter\WorkflowBpmn($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($wbap->getUid());
|
||||
} catch (\Exception $e){die($e->getMessage());}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
self::$uids[] = $wbap->getUid();
|
||||
|
||||
$this->assertNotNull($bp);
|
||||
$this->assertNotNull($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
}
|
||||
|
||||
function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Workflow/Bpmn Project #2",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #2",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
$wbap = new Project\Adapter\WorkflowBpmn();
|
||||
$wbap->create($data);
|
||||
|
||||
try {
|
||||
$bp = Project\Bpmn::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
try {
|
||||
$wp = Project\Workflow::load($wbap->getUid());
|
||||
} catch (\Exception $e){}
|
||||
|
||||
self::$uids[] = $wbap->getUid();
|
||||
|
||||
$this->assertNotEmpty($bp);
|
||||
$this->assertNotEmpty($wp);
|
||||
$this->assertEquals($bp->getUid(), $wp->getUid());
|
||||
|
||||
$project = $bp->getProject();
|
||||
$process = $wp->getProcess();
|
||||
|
||||
$this->assertEquals($project["PRJ_NAME"], $process["PRO_TITLE"]);
|
||||
$this->assertEquals($project["PRJ_DESCRIPTION"], $process["PRO_DESCRIPTION"]);
|
||||
$this->assertEquals($project["PRJ_AUTHOR"], $process["PRO_CREATE_USER"]);
|
||||
}
|
||||
}
|
||||
@@ -1,278 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class BpmnTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class BpmnTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $prjUids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//return;
|
||||
|
||||
//cleaning DB
|
||||
foreach (self::$prjUids as $prjUid) {
|
||||
$bp = Project\Bpmn::load($prjUid);
|
||||
$bp->remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRJ_NAME" => "Test BPMN Project #1",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
// Create a new Project\Bpmn and save to DB
|
||||
$bp = new Project\Bpmn($data);
|
||||
$projectData = $bp->getProject();
|
||||
self::$prjUids[] = $bp->getUid();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $projectData[$key]);
|
||||
}
|
||||
|
||||
return $bp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddDiagram($bp)
|
||||
{
|
||||
$data = array(
|
||||
"DIA_NAME" => "Sample Diagram #1"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addDiagram($data);
|
||||
|
||||
// Load from DB
|
||||
$diagramData = $bp->getDiagram();
|
||||
|
||||
$this->assertEquals($data["DIA_NAME"], $diagramData["DIA_NAME"]);
|
||||
$this->assertEquals($bp->getUid(), $diagramData["PRJ_UID"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddProcess($bp)
|
||||
{
|
||||
$data = array(
|
||||
"PRO_NAME" => "Sample Process #1"
|
||||
);
|
||||
|
||||
$diagramData = $bp->getDiagram();
|
||||
|
||||
// Save to DB
|
||||
$bp->addProcess($data);
|
||||
|
||||
// Load from DB
|
||||
$processData = $bp->getProcess();
|
||||
|
||||
$this->assertEquals($data["PRO_NAME"], $processData["PRO_NAME"]);
|
||||
$this->assertEquals($bp->getUid(), $processData["PRJ_UID"]);
|
||||
$this->assertEquals($diagramData['DIA_UID'], $processData["DIA_UID"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @var $bp \ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testAddActivity($bp)
|
||||
{
|
||||
$data = array(
|
||||
"ACT_NAME" => "Activity #1",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity($data);
|
||||
|
||||
// Load from DB
|
||||
$activities = $bp->getActivities();
|
||||
|
||||
$this->assertCount(1, $activities);
|
||||
|
||||
$activityData = $activities[0];
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @return array
|
||||
*/
|
||||
public function testAddActivityWithUid($bp)
|
||||
{
|
||||
$actUid = "f1198ddc864204561817155064020352";
|
||||
|
||||
$data = array(
|
||||
"ACT_UID" => $actUid,
|
||||
"ACT_NAME" => "Activity #X",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity($data);
|
||||
|
||||
// Load from DB
|
||||
$activities = $bp->getActivities();
|
||||
|
||||
$uids = array();
|
||||
|
||||
foreach ($activities as $activity) {
|
||||
array_push($uids, $activity["ACT_UID"]);
|
||||
}
|
||||
|
||||
$this->assertTrue(in_array($actUid, $uids));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testGetActivity($bp, $data)
|
||||
{
|
||||
// Load from DB
|
||||
$activityData = $bp->getActivity($data["ACT_UID"]);
|
||||
|
||||
// in data is set a determined UID for activity created in previous step
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
|
||||
// Testing with an invalid uid
|
||||
$this->assertNull($bp->getActivity("INVALID-UID"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testUpdateActivity($bp, $data)
|
||||
{
|
||||
$updateData = array(
|
||||
"ACT_NAME" => "Activity #X (Updated)",
|
||||
"BOU_X" => "251",
|
||||
"BOU_Y" => "252"
|
||||
);
|
||||
|
||||
// Save to DB
|
||||
$bp->updateActivity($data["ACT_UID"], $updateData);
|
||||
|
||||
// Load from DB
|
||||
$activityData = $bp->getActivity($data["ACT_UID"]);
|
||||
|
||||
foreach ($updateData as $key => $value) {
|
||||
$this->assertEquals($value, $activityData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
* @depends testAddActivityWithUid
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @param $data
|
||||
*/
|
||||
public function testRemoveActivity($bp, $data)
|
||||
{
|
||||
$this->assertCount(2, $bp->getActivities());
|
||||
|
||||
$bp->removeActivity($data["ACT_UID"]);
|
||||
|
||||
$this->assertCount(1, $bp->getActivities());
|
||||
}
|
||||
|
||||
public function testGetActivities()
|
||||
{
|
||||
// Create a new Project\Bpmn and save to DB
|
||||
$bp = new Project\Bpmn(array(
|
||||
"PRJ_NAME" => "Test BPMN Project #2",
|
||||
"PRJ_DESCRIPTION" => "Description for - Test BPMN Project #1",
|
||||
"PRJ_AUTHOR" => "00000000000000000000000000000001"
|
||||
));
|
||||
$bp->addDiagram();
|
||||
$bp->addProcess();
|
||||
|
||||
$this->assertCount(0, $bp->getActivities());
|
||||
|
||||
// Save to DB
|
||||
$bp->addActivity(array(
|
||||
"ACT_NAME" => "Activity #2",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$bp->addActivity(array(
|
||||
"ACT_NAME" => "Activity #3",
|
||||
"BOU_X" => "50",
|
||||
"BOU_Y" => "50"
|
||||
));
|
||||
|
||||
$this->assertCount(2, $bp->getActivities());
|
||||
|
||||
return $bp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testGetActivities
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @return null|\ProcessMaker\Project\Bpmn
|
||||
*/
|
||||
public function testLoad($bp)
|
||||
{
|
||||
$prjUid = $bp->getUid();
|
||||
$bp2 = Project\Bpmn::load($prjUid);
|
||||
|
||||
$this->assertNotNull($bp2);
|
||||
$this->assertEquals($bp->getActivities(), $bp2->getActivities());
|
||||
$this->assertEquals($bp->getDiagram(), $bp2->getDiagram());
|
||||
$this->assertEquals($bp->getProcess(), $bp2->getProcess());
|
||||
|
||||
return $bp2;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testLoad
|
||||
* @param $bp \ProcessMaker\Project\Bpmn
|
||||
* @expectedException \ProcessMaker\Exception\ProjectNotFound
|
||||
* @expectedExceptionCode 20
|
||||
*/
|
||||
public function testRemove($bp)
|
||||
{
|
||||
$prjUid = $bp->getUid();
|
||||
$bp->remove();
|
||||
|
||||
Project\Bpmn::load($prjUid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,287 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Project;
|
||||
|
||||
use \ProcessMaker\Project;
|
||||
|
||||
if (! class_exists("Propel")) {
|
||||
include_once __DIR__ . "/../../bootstrap.php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Class WorkflowTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class WorkflowTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected static $proUids = array();
|
||||
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
//cleaning DB
|
||||
foreach (self::$proUids as $proUid) {
|
||||
$wp = Project\Workflow::load($proUid);
|
||||
$wp->remove();
|
||||
}
|
||||
}
|
||||
|
||||
public function testCreate()
|
||||
{
|
||||
$data = array(
|
||||
"PRO_TITLE" => "Test Project #1",
|
||||
"PRO_DESCRIPTION" => "Description for - Test Project #1",
|
||||
"PRO_CATEGORY" => "",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
);
|
||||
|
||||
$wp = new Project\Workflow($data);
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$processData = $wp->getProcess();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $processData[$key]);
|
||||
}
|
||||
|
||||
return $wp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testAddTask($wp)
|
||||
{
|
||||
$data = array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_DESCRIPTION" => "Description for task #1",
|
||||
"TAS_POSX" => "50",
|
||||
"TAS_POSY" => "50",
|
||||
"TAS_WIDTH" => "100",
|
||||
"TAS_HEIGHT" => "25"
|
||||
);
|
||||
|
||||
$tasUid = $wp->addTask($data);
|
||||
|
||||
$taskData = $wp->getTask($tasUid);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $taskData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testUpdateTask($wp)
|
||||
{
|
||||
$data = array(
|
||||
"TAS_TITLE" => "task #1 (updated)",
|
||||
"TAS_POSX" => "150",
|
||||
"TAS_POSY" => "250"
|
||||
);
|
||||
|
||||
// at this time, there is only one task
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
|
||||
$wp->updateTask($tasks[0]['TAS_UID'], $data);
|
||||
$taskData = $wp->getTask($tasks[0]['TAS_UID']);
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$this->assertEquals($data[$key], $taskData[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testRemoveTask($wp)
|
||||
{
|
||||
$tasUid = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "150",
|
||||
"TAS_POSY" => "250"
|
||||
));
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(2, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreate
|
||||
*/
|
||||
public function testGetTasks($wp)
|
||||
{
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "250",
|
||||
"TAS_POSY" => "250"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "350",
|
||||
"TAS_POSY" => "350"
|
||||
));
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(3, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid1);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(2, $tasks);
|
||||
|
||||
$wp->removeTask($tasUid2);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(1, $tasks);
|
||||
|
||||
$wp->removeTask($tasks[0]['TAS_UID']);
|
||||
|
||||
$tasks = $wp->getTasks();
|
||||
$this->assertInternalType('array', $tasks);
|
||||
$this->assertCount(0, $tasks);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function testAddRoute()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Project #2 (Sequential)",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "410",
|
||||
"TAS_POSY" => "61"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "159",
|
||||
"TAS_POSY" => "370"
|
||||
));
|
||||
|
||||
$rouUid = $wp->addRoute($tasUid1, $tasUid2, "SEQUENTIAL");
|
||||
|
||||
$routeSaved = $wp->getRoute($rouUid);
|
||||
|
||||
$this->assertEquals($tasUid1, $routeSaved['TAS_UID']);
|
||||
$this->assertEquals($tasUid2, $routeSaved['ROU_NEXT_TASK']);
|
||||
$this->assertEquals("SEQUENTIAL", $routeSaved['ROU_TYPE']);
|
||||
}
|
||||
|
||||
public function testAddSelectRoute()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Project #3 (Select)",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
self::$proUids[] = $wp->getUid();
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "410",
|
||||
"TAS_POSY" => "61"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "159",
|
||||
"TAS_POSY" => "370"
|
||||
));
|
||||
$tasUid3 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "670",
|
||||
"TAS_POSY" => "372"
|
||||
));
|
||||
|
||||
$wp->addSelectRoute($tasUid1, array($tasUid2, $tasUid3));
|
||||
}
|
||||
|
||||
public function testCompleteWorkflowProject()
|
||||
{
|
||||
$wp = new Project\Workflow(array(
|
||||
"PRO_TITLE" => "Test Complete Project #4",
|
||||
"PRO_CREATE_USER" => "00000000000000000000000000000001"
|
||||
));
|
||||
|
||||
$tasUid1 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #1",
|
||||
"TAS_POSX" => "406",
|
||||
"TAS_POSY" => "71"
|
||||
));
|
||||
$tasUid2 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #2",
|
||||
"TAS_POSX" => "188",
|
||||
"TAS_POSY" => "240"
|
||||
));
|
||||
$tasUid3 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #3",
|
||||
"TAS_POSX" => "406",
|
||||
"TAS_POSY" => "239"
|
||||
));
|
||||
$tasUid4 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #4",
|
||||
"TAS_POSX" => "294",
|
||||
"TAS_POSY" => "366"
|
||||
));
|
||||
$tasUid5 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #5",
|
||||
"TAS_POSX" => "640",
|
||||
"TAS_POSY" => "240"
|
||||
));
|
||||
$tasUid6 = $wp->addTask(array(
|
||||
"TAS_TITLE" => "task #6",
|
||||
"TAS_POSX" => "640",
|
||||
"TAS_POSY" => "359"
|
||||
));
|
||||
|
||||
|
||||
$wp->addRoute($tasUid1, $tasUid2, "PARALLEL");
|
||||
$wp->addRoute($tasUid1, $tasUid3, "PARALLEL");
|
||||
$wp->addRoute($tasUid1, $tasUid5, "PARALLEL");
|
||||
|
||||
$wp->addRoute($tasUid2, $tasUid4, "SEC-JOIN");
|
||||
$wp->addRoute($tasUid3, $tasUid4, "SEC-JOIN");
|
||||
|
||||
$wp->addRoute($tasUid5, $tasUid6, "EVALUATE");
|
||||
$wp->addRoute($tasUid5, "-1", "EVALUATE");
|
||||
|
||||
$wp->setStartTask($tasUid1);
|
||||
|
||||
$wp->setEndTask($tasUid4);
|
||||
$wp->setEndTask($tasUid6);
|
||||
|
||||
return $wp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCompleteWorkflowProject
|
||||
* @param $wp \ProcessMaker\Project\Workflow
|
||||
* @expectedException \ProcessMaker\Exception\ProjectNotFound
|
||||
* @expectedExceptionCode 20
|
||||
*/
|
||||
public function testRemove($wp)
|
||||
{
|
||||
$proUid = $wp->getUid();
|
||||
$wp->remove();
|
||||
|
||||
Project\Workflow::load($proUid);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
namespace Tests\ProcessMaker\Util;
|
||||
|
||||
|
||||
use ProcessMaker\Util;
|
||||
|
||||
/**
|
||||
* Class XmlExporterTest
|
||||
*
|
||||
* @package Tests\ProcessMaker\Project
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
class XmlExporterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testGetLastVersion()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/first/sample-*.txt");
|
||||
$this->assertEquals(3, $lastVer);
|
||||
}
|
||||
|
||||
function testGetLastVersionSec()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/second/sample-*.txt");
|
||||
|
||||
$this->assertEquals(5, $lastVer);
|
||||
}
|
||||
|
||||
function testGetLastVersionThr()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(__DIR__."/../../fixtures/files_struct/third/sample-*.txt");
|
||||
|
||||
$this->assertEquals("3.1.9", $lastVer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Negative test, no matched files found
|
||||
*/
|
||||
function testGetLastVersionOther()
|
||||
{
|
||||
$lastVer = Util\Common::getLastVersion(sys_get_temp_dir()."/sample-*.txt");
|
||||
|
||||
$this->assertEquals(0, $lastVer);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
include "pm-bootstrap.php";
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
pm_home_dir = "/Users/erik/devel/colosa/processmaker"
|
||||
workspace = workflow
|
||||
lang = en
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1 +0,0 @@
|
||||
file sample-1.txt
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
//
|
||||
// pm-bootstrap.php
|
||||
//
|
||||
|
||||
/*
|
||||
* PmBootstrap for Test Unit Suite
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
|
||||
*/
|
||||
|
||||
$config = parse_ini_file(__DIR__ . DIRECTORY_SEPARATOR . "config.ini");
|
||||
|
||||
$workspace = $config['workspace'];
|
||||
$lang = $config['lang'];
|
||||
$processMakerHome = $config['pm_home_dir'];
|
||||
$rootDir = realpath($processMakerHome) . DIRECTORY_SEPARATOR;
|
||||
|
||||
require $rootDir . "framework/src/Maveriks/Util/ClassLoader.php";
|
||||
|
||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
||||
$loader->add($rootDir . 'framework/src/', "Maveriks");
|
||||
$loader->add($rootDir . 'workflow/engine/src/', "ProcessMaker");
|
||||
$loader->add($rootDir . 'workflow/engine/src/');
|
||||
|
||||
// add vendors to autoloader
|
||||
$loader->add($rootDir . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
||||
$loader->addClass("Bootstrap", $rootDir . 'gulliver/system/class.bootstrap.php');
|
||||
|
||||
$loader->addModelClassPath($rootDir . "workflow/engine/classes/model/");
|
||||
|
||||
$app = new Maveriks\WebApplication();
|
||||
$app->setRootDir($rootDir);
|
||||
$app->loadEnvironment($workspace);
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* functional.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is part of the symfony package.
|
||||
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
// guess current application
|
||||
if (!isset($app))
|
||||
{
|
||||
$traces = debug_backtrace();
|
||||
$caller = $traces[0];
|
||||
$app = array_pop(explode(DIRECTORY_SEPARATOR, dirname($caller['file'])));
|
||||
}
|
||||
|
||||
// define symfony constant
|
||||
define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/../..'));
|
||||
define('SF_APP', $app);
|
||||
define('SF_ENVIRONMENT', 'test');
|
||||
define('SF_DEBUG', true);
|
||||
|
||||
// initialize symfony
|
||||
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
|
||||
|
||||
// remove all cache
|
||||
sfToolkit::clearDirectory(sfConfig::get('sf_cache_dir'));
|
||||
@@ -1,103 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* gulliverConstants.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//***************** URL KEY *********************************************
|
||||
define("URL_KEY", 'c0l0s40pt1mu59r1m3' );
|
||||
|
||||
//***************** System Directories & Paths **************************
|
||||
define('PATH_SEP', '/');
|
||||
|
||||
define( 'PATH_HOME', '/opt/processmaker/trunk/workflow/' );
|
||||
define( 'PATH_GULLIVER_HOME', '/opt/processmaker/trunk/gulliver' . PATH_SEP );
|
||||
//define( 'PATH_GULLIVER_HOME', $pathTrunk . 'gulliver' . PATH_SEP );
|
||||
define( 'PATH_RBAC_HOME', $pathTrunk . 'rbac' . PATH_SEP );
|
||||
define( 'PATH_DATA', '/shared/workflow_data/');
|
||||
|
||||
// the other directories
|
||||
define( 'PATH_GULLIVER', PATH_GULLIVER_HOME . 'system' . PATH_SEP ); //gulliver system classes
|
||||
define( 'PATH_TEMPLATE', PATH_GULLIVER_HOME . 'templates' . PATH_SEP );
|
||||
define( 'PATH_THIRDPARTY', PATH_GULLIVER_HOME . 'thirdparty' . PATH_SEP );
|
||||
define( 'PATH_RBAC', PATH_RBAC_HOME . 'engine/classes' . PATH_SEP ); //to enable rbac version 2
|
||||
define( 'PATH_HTML', PATH_HOME . 'public_html' . PATH_SEP );
|
||||
|
||||
// Application's General Directories
|
||||
define( 'PATH_CORE', PATH_HOME . 'engine' . PATH_SEP );
|
||||
define( 'PATH_SKINS', PATH_CORE . 'skins' . PATH_SEP );
|
||||
define( 'PATH_METHODS', PATH_CORE . 'methods' . PATH_SEP );
|
||||
define( 'PATH_XMLFORM', PATH_CORE . 'xmlform' . PATH_SEP );
|
||||
|
||||
//************ include Gulliver Class **************
|
||||
require_once( PATH_GULLIVER . PATH_SEP . 'class.g.php');
|
||||
|
||||
// the Compiled Directories
|
||||
define( 'PATH_C', $pathOutTrunk . 'compiled/');
|
||||
|
||||
// the Smarty Directories
|
||||
if ( strstr ( getenv ( 'OS' ), 'Windows' ) ) {
|
||||
define( 'PATH_SMARTY_C', 'c:/tmp/smarty/c' );
|
||||
define( 'PATH_SMARTY_CACHE', 'c:/tmp/smarty/cache' );
|
||||
}
|
||||
else {
|
||||
define( 'PATH_SMARTY_C', PATH_C . 'smarty/c' );
|
||||
define( 'PATH_SMARTY_CACHE', PATH_C . 'smarty/cache' );
|
||||
}
|
||||
|
||||
if (!is_dir(PATH_SMARTY_C)) G::mk_dir(PATH_SMARTY_C);
|
||||
if (!is_dir(PATH_SMARTY_CACHE)) G::mk_dir(PATH_SMARTY_CACHE);
|
||||
|
||||
|
||||
// Other Paths
|
||||
//define( 'PATH_DB' , PATH_HOME . 'engine' . PATH_SEP . 'db' . PATH_SEP);
|
||||
define( 'PATH_DB' , PATH_DATA . 'sites' . PATH_SEP );
|
||||
define( 'PATH_RTFDOCS' , PATH_CORE . 'rtf_templates' . PATH_SEP );
|
||||
define( 'PATH_HTMLMAIL', PATH_CORE . 'html_templates' . PATH_SEP );
|
||||
define( 'PATH_TPL' , PATH_CORE . 'templates' . PATH_SEP );
|
||||
define( 'PATH_DYNACONT', PATH_CORE . 'content' . PATH_SEP . 'dynaform' . PATH_SEP );
|
||||
define( 'PATH_LANGUAGECONT', PATH_CORE . 'content' . PATH_SEP . 'languages' . PATH_SEP );
|
||||
define( 'SYS_UPLOAD_PATH', PATH_HOME . "public_html/files/" );
|
||||
define( 'PATH_UPLOAD', PATH_HTML . 'files/');
|
||||
|
||||
|
||||
define ('DB_HOST', '192.168.0.10' );
|
||||
define ('DB_NAME', 'wf_opensource' );
|
||||
define ('DB_USER', 'fluid' );
|
||||
define ('DB_PASS', 'fluid2000' );
|
||||
define ('DB_RBAC_NAME', 'rbac_os' );
|
||||
define ('DB_RBAC_USER', 'rbac_os' );
|
||||
define ('DB_RBAC_PASS', '873821w3n2u719tx' );
|
||||
define ('DB_WIZARD_REPORT_SYS', 'report_os' );
|
||||
define ('DB_WIZARD_REPORT_USER', 'rep_os' );
|
||||
define ('DB_WIZARD_REPORT_PASS', '3r357ichy6b95s88' );
|
||||
|
||||
define ( 'SF_ROOT_DIR', PATH_CORE );
|
||||
define ( 'SF_APP', 'app' );
|
||||
define ( 'SF_ENVIRONMENT', 'env' );
|
||||
|
||||
set_include_path(
|
||||
PATH_THIRDPARTY . PATH_SEPARATOR .
|
||||
PATH_THIRDPARTY . 'pear' . PATH_SEPARATOR .
|
||||
get_include_path()
|
||||
);
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* unit.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
ini_set('short_open_tag', 'on');
|
||||
ini_set('asp_tags', 'on');
|
||||
ini_set('memory_limit', '80M');
|
||||
|
||||
if ( PHP_OS == 'WINNT' )
|
||||
define('PATH_SEP', '\\');
|
||||
else
|
||||
define('PATH_SEP', '/');
|
||||
|
||||
|
||||
//***************** Defining the Home Directory *********************************
|
||||
$docuroot = explode ( PATH_SEP , $_SERVER['PWD'] );
|
||||
array_pop($docuroot);
|
||||
$pathhome = implode( PATH_SEP, $docuroot );
|
||||
define('PATH_HOME', $pathhome . PATH_SEP );
|
||||
$gulliverConfig = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php';
|
||||
$definesConfig = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'defines.php';
|
||||
|
||||
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
|
||||
//in a normal installation you don't need to change it.
|
||||
array_pop($docuroot);
|
||||
$pathTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
|
||||
array_pop($docuroot);
|
||||
$pathOutTrunk = implode( PATH_SEP, $docuroot ) . PATH_SEP ;
|
||||
// to do: check previous algorith for Windows $pathTrunk = "c:/home/";
|
||||
|
||||
define('PATH_TRUNK', $pathTrunk );
|
||||
define('PATH_OUTTRUNK', $pathOutTrunk );
|
||||
|
||||
if (file_exists( $gulliverConfig )) {
|
||||
include ( $gulliverConfig );
|
||||
}
|
||||
|
||||
if (file_exists( $definesConfig )) {
|
||||
include ( $definesConfig );
|
||||
}
|
||||
|
||||
//$_test_dir = realpath(dirname(__FILE__).'/..');
|
||||
//require_once( 'lime/lime.php');
|
||||
if(file_exists(PATH_GULLIVER . "class.bootstrap.php")) {
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
}
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
Bootstrap::registerClass('G', PATH_GULLIVER . "class.g.php");
|
||||
Bootstrap::registerClass('System', PATH_HOME . "engine/classes/class.system.php");
|
||||
// Call more Classes
|
||||
Bootstrap::registerClass('headPublisher', PATH_GULLIVER . "class.headPublisher.php");
|
||||
Bootstrap::registerClass('publisher', PATH_GULLIVER . "class.publisher.php");
|
||||
Bootstrap::registerClass('xmlform', PATH_GULLIVER . "class.xmlform.php");
|
||||
Bootstrap::registerClass('XmlForm_Field', PATH_GULLIVER . "class.xmlform.php");
|
||||
Bootstrap::registerClass('xmlformExtension', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('form', PATH_GULLIVER . "class.form.php");
|
||||
Bootstrap::registerClass('menu', PATH_GULLIVER . "class.menu.php");
|
||||
Bootstrap::registerClass('Xml_Document', PATH_GULLIVER . "class.xmlDocument.php");
|
||||
Bootstrap::registerClass('DBSession', PATH_GULLIVER . "class.dbsession.php");
|
||||
Bootstrap::registerClass('DBConnection', PATH_GULLIVER . "class.dbconnection.php");
|
||||
Bootstrap::registerClass('DBRecordset', PATH_GULLIVER . "class.dbrecordset.php");
|
||||
Bootstrap::registerClass('DBTable', PATH_GULLIVER . "class.dbtable.php");
|
||||
Bootstrap::registerClass('xmlMenu', PATH_GULLIVER . "class.xmlMenu.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_FastSearch', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_XmlMenu', PATH_GULLIVER . "class.xmlMenu.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_WYSIWYG_EDITOR', PATH_GULLIVER . "class.wysiwygEditor.php");
|
||||
Bootstrap::registerClass('Controller', PATH_GULLIVER . "class.controller.php");
|
||||
Bootstrap::registerClass('HttpProxyController', PATH_GULLIVER . "class.httpProxyController.php");
|
||||
Bootstrap::registerClass('templatePower', PATH_GULLIVER . "class.templatePower.php");
|
||||
Bootstrap::registerClass('XmlForm_Field_SimpleText', PATH_GULLIVER . "class.xmlformExtension.php");
|
||||
Bootstrap::registerClass('Propel', PATH_THIRDPARTY . "propel/Propel.php");
|
||||
Bootstrap::registerClass('Creole', PATH_THIRDPARTY . "creole/Creole.php");
|
||||
Bootstrap::registerClass('Criteria', PATH_THIRDPARTY . "propel/util/Criteria.php");
|
||||
Bootstrap::registerClass('Groups', PATH_HOME . "engine/classes/class.groups.php");
|
||||
Bootstrap::registerClass('Tasks', PATH_HOME . "engine/classes/class.tasks.php");
|
||||
Bootstrap::registerClass('Calendar', PATH_HOME . "engine/classes/class.calendar.php");
|
||||
Bootstrap::registerClass('processMap', PATH_HOME . "engine/classes/class.processMap.php");
|
||||
|
||||
Bootstrap::registerSystemClasses();
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeFunction.php');
|
||||
require_once( PATH_THIRDPARTY . 'pake' . PATH_SEP . 'pakeGetopt.class.php');
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
if ( !defined ( 'G_ENVIRONMENT') )
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV );
|
||||
|
||||
40
workflow/engine/test/fixtures/appDelegation.yml
vendored
40
workflow/engine/test/fixtures/appDelegation.yml
vendored
@@ -1,40 +0,0 @@
|
||||
CreateAppDelegations:
|
||||
-
|
||||
Title: "Create AppDelegation with Empty $Fields"
|
||||
Function: "CreateEmptyAppDelegation"
|
||||
Input:
|
||||
Output:
|
||||
Type: "G_Error"
|
||||
-
|
||||
Title: "Create Duplicated AppDelegation"
|
||||
Function: "CreateDuplicated"
|
||||
Input:
|
||||
APP_UID: "1DUPLICATED1"
|
||||
DEL_INDEX: 2
|
||||
PRO_UID[]: "guid.pm"
|
||||
TAS_UID[]: "guid.pm"
|
||||
Output:
|
||||
Type: "G_Error"
|
||||
-
|
||||
TODO: "Review: Error catch in CreateAppDelegation capture Propel Errors but return the same G_Error information."
|
||||
-
|
||||
Title: "Create random new AppDelegation"
|
||||
Function: "CreateNewAppDelegation"
|
||||
Input:
|
||||
APP_UID[]: "guid.pm"
|
||||
DEL_INDEX[]: "rand.number"
|
||||
PRO_UID[]: "guid.pm"
|
||||
TAS_UID[]: "guid.pm"
|
||||
DEL_TYPE[]: "*.DEL_TYPE.pm"
|
||||
DEL_THREAD_STATUS[]: "*.DEL_THREAD_STATUS.pm"
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
TODO: "Review: There isn't a 'function delete'. Is it required?"
|
||||
DeleteCretedAppDelegations:
|
||||
-
|
||||
Title: "Deleting created AppDelegations"
|
||||
Input:
|
||||
Fields[]:"*.createdAppDel"
|
||||
Output:
|
||||
Value: "true"
|
||||
100
workflow/engine/test/fixtures/appDocument.yml
vendored
100
workflow/engine/test/fixtures/appDocument.yml
vendored
@@ -1,100 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the application document data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
APP_DOC_UID: "1"
|
||||
Output:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the application document data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the application document data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
APP_DOC_UID: "2"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "INPUT"
|
||||
APP_DOC_CREATE_DATE: "2007-12-31 23:59:59"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME"
|
||||
Output:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the application document data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
APP_DOC_UID: ""
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "INPUT"
|
||||
APP_DOC_CREATE_DATE: "2007-12-31 23:59:59"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the application document data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
APP_DOC_UID: "1"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "OUTPUT"
|
||||
APP_DOC_CREATE_DATE: "2008-01-01 00:00:00"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE1"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT1"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME1"
|
||||
Output:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the application document data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
APP_UID: "2"
|
||||
DEL_INDEX: "2"
|
||||
DOC_UID: "2"
|
||||
USR_UID: "2"
|
||||
APP_DOC_TYPE: "OUTPUT"
|
||||
APP_DOC_CREATE_DATE: "2008-01-01 00:00:00"
|
||||
APP_DOC_TITLE: "APP_DOC_TITLE1"
|
||||
APP_DOC_COMMENT: "APP_DOC_COMMENT1"
|
||||
APP_DOC_FILENAME: "APP_DOC_FILENAME1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the application document data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
APP_DOC_UID: "2"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the application document data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
APP_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
10
workflow/engine/test/fixtures/application.yml
vendored
10
workflow/engine/test/fixtures/application.yml
vendored
@@ -1,10 +0,0 @@
|
||||
fields:
|
||||
PRO_UID: '346FAE3953CC69'
|
||||
APP_PARENT: ''
|
||||
APP_STATUS: 'DRAFT'
|
||||
APP_PROC_STATUS: 'STATUS'
|
||||
APP_PROC_CODE: '12345678'
|
||||
APP_PARALLEL: 'N'
|
||||
APP_INIT_USER: 'ABC123'
|
||||
APP_CUR_USER: 'ABC123'
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
FirstStepTestCases:
|
||||
-
|
||||
Title: "@#Function(): Create some non Parallel Cases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "SaveTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_PARALLEL: "N"
|
||||
APP_INIT_USER: "@G::generateUniqueID()"
|
||||
APP_CUR_USER: "@G::generateUniqueID()"
|
||||
APP_CREATE_DATE: "@date(Y-m-d)"
|
||||
APP_INIT_DATE: "0000-00-00"
|
||||
APP_FINISH_DATE: "0000-00-00"
|
||||
APP_UPDATE_DATE: "@date(Y-m-d)"
|
||||
APP_STATUS[]:"*.nonParallelStatus.applicationInput"
|
||||
APP_PARENT: "0"
|
||||
APP_PROC_STATUS: ""
|
||||
APP_PROC_CODE: ""
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
Title: "@#Function(): Create one parallel Case (Force to be parallel)"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "SaveTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_PARALLEL: "Y"
|
||||
APP_STATUS: "PARALLEL"
|
||||
APP_PARENT: "0"
|
||||
APP_PROC_STATUS: ""
|
||||
APP_PROC_CODE: ""
|
||||
APP_INIT_USER: "@G::generateUniqueID()"
|
||||
APP_CUR_USER: "@G::generateUniqueID()"
|
||||
APP_CREATE_DATE: "@date(Y-m-d)"
|
||||
APP_INIT_DATE: "0000-00-00"
|
||||
APP_FINISH_DATE: "0000-00-00"
|
||||
Output:
|
||||
Type: "string"
|
||||
SecondStepTestCases:
|
||||
-
|
||||
Title: "@#Function(): Update one of LastCreatedCases with all diferent types of status"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "UpdateTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "LAST_CREATED_CASE"
|
||||
APP_STATUS[]: "*.APP_STATUS.pm"
|
||||
Output:
|
||||
Type: "string"
|
||||
-
|
||||
Title: "@#Function(): Loads all LastCreatedCases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "LoadTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "*.LAST_CREATED_CASE"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
-
|
||||
Title: "@#Function(): Delete all LastCreatedCases"
|
||||
Class: "applicationTest"
|
||||
Instance: $obj
|
||||
Function: "DeleteTest"
|
||||
Input:
|
||||
PRO_UID: "8475E6C841051A"
|
||||
APP_UID[]: "*.LAST_CREATED_CASE"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
nonParallelStatus:
|
||||
- "DRAFT"
|
||||
- "CANCEL"
|
||||
47
workflow/engine/test/fixtures/configuration.yml
vendored
47
workflow/engine/test/fixtures/configuration.yml
vendored
@@ -1,47 +0,0 @@
|
||||
CreateTestConfigurations:
|
||||
-
|
||||
Title:"Creating new Configurations"
|
||||
Function:"CreateConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"guid.pm"
|
||||
OBJ_UID[]:"guid.pm"
|
||||
PRO_UID[]:"guid.pm"
|
||||
USR_UID[]:"guid.pm"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Value: 1
|
||||
ConfigurationUnitTest:
|
||||
-
|
||||
Title:"Updating Configurations"
|
||||
Function:"UpdateConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
CFG_VALUE[]:"*.text.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Configurations"
|
||||
Function:"LoadConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Configurations"
|
||||
Function:"RemoveConfiguration"
|
||||
Input:
|
||||
CFG_UID[]:"CREATED_UID"
|
||||
OBJ_UID[]:"CREATED_OBJ"
|
||||
PRO_UID[]:"CREATED_PRO"
|
||||
USR_UID[]:"CREATED_USR"
|
||||
APP_UID:""
|
||||
Output:
|
||||
Type: "NULL"
|
||||
71
workflow/engine/test/fixtures/content.yml
vendored
71
workflow/engine/test/fixtures/content.yml
vendored
@@ -1,71 +0,0 @@
|
||||
loadContent:
|
||||
-
|
||||
Title: "LoadContent method"
|
||||
Function: "loadContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'Content Example'
|
||||
Output:
|
||||
Type: "string"
|
||||
deleteContent:
|
||||
-
|
||||
Title: "delete a row "
|
||||
Function: "deleteContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
Output:
|
||||
Type: "NULL"
|
||||
-
|
||||
Title: "delete a row "
|
||||
Function: "deleteContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
Output:
|
||||
Type: "NULL"
|
||||
addContent1:
|
||||
-
|
||||
Title: "addContent method, calling the first time"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'addContent method, calling the first time'
|
||||
Output:
|
||||
Type: integer
|
||||
addContentTwice:
|
||||
-
|
||||
Title: "validate duplicate row, with the addContent method"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '9876543210'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: 'validate duplicate row, now update the row'
|
||||
Output:
|
||||
Type: "integer"
|
||||
addContentAcentos:
|
||||
-
|
||||
Title: "add content with acentos"
|
||||
Function: "addContent"
|
||||
Input:
|
||||
CON_CATEGORY: 'ABC_CATEGORY'
|
||||
CON_PARENT: '1234567890'
|
||||
CON_ID: '6475576C725EA4'
|
||||
CON_LANG: 'it'
|
||||
CON_VALUE: '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
Output:
|
||||
Type: "integer"
|
||||
|
||||
|
||||
34
workflow/engine/test/fixtures/departments.txt
vendored
34
workflow/engine/test/fixtures/departments.txt
vendored
@@ -1,34 +0,0 @@
|
||||
ExecutivePresident|
|
||||
Marketing|ExecutivePresident
|
||||
SalesDivision|ExecutivePresident
|
||||
RiskManager|Sales
|
||||
NationalSales|Sales
|
||||
InternationalSales|Sales
|
||||
EuropeSales|InternationalSales
|
||||
USASales|InternationalSales
|
||||
JapanSales|InternationalSales
|
||||
InternetSales|Sales
|
||||
AdministrativeDivision|ExecutivePresident
|
||||
Accounting|AdministrativeDivision
|
||||
HumanResources|AdministrativeDivision
|
||||
InfraestructureManagement|AdministrativeDivision
|
||||
Facilities|InfraestructureManagement
|
||||
VehicleMaintenance|InfraestructureManagement
|
||||
InvestigativeDivision|ExecutivePresident
|
||||
Legal|InvestigativeDivision
|
||||
DetectiveSection|InvestigativeDivision
|
||||
Records|InvestigativeDivision
|
||||
EuropeRegional|
|
||||
SupportServiceDivision|ExecutivePresident
|
||||
InformationDesk|SupportServiceDivision
|
||||
TechnologicalResearch|SupportServiceDivision
|
||||
Landlinetelephony|SupportServiceDivision
|
||||
MobileServices|SupportServiceDivision
|
||||
FinanceDivision|ExecutivePresident
|
||||
PlanningandResearch|FinanceDivision
|
||||
DeputyDirector|FinanceDivision
|
||||
OperacionDivision|ExecutivePresident
|
||||
SystemAdministration|OperacionDivision
|
||||
SecurityOfficer|OperacionDivision
|
||||
OperationandBusiness|OperacionDivision
|
||||
SpecialOperations|OperationandBusiness
|
||||
28
workflow/engine/test/fixtures/derivation.yml
vendored
28
workflow/engine/test/fixtures/derivation.yml
vendored
@@ -1,28 +0,0 @@
|
||||
StartCase1:
|
||||
-
|
||||
Title: "Start a new application @#Function()"
|
||||
Function: "StartCaseTest"
|
||||
Input:
|
||||
TAS_UID: "4475E6C8E10346"
|
||||
USR_UID: "4475E6E07C261E"
|
||||
firstname[]: "@@SYS_LANG"
|
||||
lastname[]: "last.name.es"
|
||||
Output:
|
||||
Type: "array"
|
||||
StartCase2:
|
||||
-
|
||||
Title: "Start a new application (pseudo derivate)"
|
||||
Function: "StartCaseTest"
|
||||
Input:
|
||||
TAS_UID: "4475E6C8E10346"
|
||||
USR_UID: "4475E6E07C261E"
|
||||
Output:
|
||||
Type: "array"
|
||||
DeleteCreatedApplications:
|
||||
-
|
||||
Title: "Delete created applications"
|
||||
Function: "DeleteCase"
|
||||
Input:
|
||||
APP_UID[]: "*.CREATED_APPLICATIONS"
|
||||
Output:
|
||||
Type: "array"
|
||||
34
workflow/engine/test/fixtures/domain.yml
vendored
34
workflow/engine/test/fixtures/domain.yml
vendored
@@ -1,34 +0,0 @@
|
||||
pm:
|
||||
APP_STATUS:
|
||||
- "DRAFT"
|
||||
- "CANCEL"
|
||||
- "PARALLEL"
|
||||
DEL_TYPE:
|
||||
- "NORMAL"
|
||||
DEL_THREAD_STATUS:
|
||||
- "OPEN"
|
||||
- "CLOSED"
|
||||
yesno:
|
||||
- "Y"
|
||||
- "N"
|
||||
guid:
|
||||
- "@G::generateUniqueID()"
|
||||
stepUidObj:
|
||||
- "DYNAFORM"
|
||||
- "INPUT_DOCUMENT"
|
||||
- "MESSAGE"
|
||||
- "OUTPUT_DOCUMENT"
|
||||
date:
|
||||
today:
|
||||
- "@date(Y-m-d)"
|
||||
time:
|
||||
today:
|
||||
- "@date(H:i:s)"
|
||||
datetime:
|
||||
today:
|
||||
- "@date(Y-m-d H:i:s)"
|
||||
number:
|
||||
percentage:
|
||||
- "@eval(return rand(0,100\))"
|
||||
rand:
|
||||
-"@rand()"
|
||||
59
workflow/engine/test/fixtures/es.yml
vendored
59
workflow/engine/test/fixtures/es.yml
vendored
@@ -1,59 +0,0 @@
|
||||
name:
|
||||
first:
|
||||
- David
|
||||
- Julio
|
||||
- Mauricio
|
||||
- Wilmer
|
||||
- Fernando
|
||||
- Hugo
|
||||
- Ramiro
|
||||
last:
|
||||
- Callizaya
|
||||
- Avendaño
|
||||
- Veliz
|
||||
- Maborak
|
||||
- Ontiveros
|
||||
- Loza
|
||||
- Cuentas
|
||||
group:
|
||||
- Administración
|
||||
- Consultores
|
||||
- Desarrollo
|
||||
- Gerencia
|
||||
- Ventas
|
||||
- Business Development
|
||||
- Redes y Servidores
|
||||
- Soporte y Entrenamiento
|
||||
- Otros
|
||||
text:
|
||||
- ¿Por qué la ciencia se empeña en comprender el universo si todavia no comprende al ser humano?
|
||||
- Tengo una demostración maravillosa...
|
||||
- La ciencia es la verdadera sabiduría.
|
||||
- El verdadero amante de la vida es el cientifico, pues es el único que se ocupa de descubrir sus misterios.
|
||||
- El conocimiento es patrimonio de la humanidad, no es solo tuyo, trasmítelo para beneficio de toda la humanidad.
|
||||
- La ciencia es la necesidad de demostrar lo que nos acontece.
|
||||
- Cada uno de nosotros es un modelo totalmente nuevo, parecido a otros modelos pero totalmente diferente.
|
||||
- ¿Por qué las moras negras están rojas cuando están verdes?
|
||||
- La ciencia es la manera estadísticamente correcta de contar novelas.
|
||||
- La ciencia de vivir es el arte de amar.
|
||||
- La ciencia es la explicación de lo inexplicable.
|
||||
- Un ser humano es algo más que la suma de sus genes.
|
||||
- La ciencia es el idioma del hombre.
|
||||
- La ciencia me dió lo que soy, un buen hombre. La ciencia me ayudará a ayudar a las personas.
|
||||
- Para ser científico debo afirmar lo que veo y negar lo que creo.
|
||||
- La ciencia es el arte de bosquejar para los demás los fenómenos de la naturaleza...
|
||||
- La ciencia es el instrumento más poderoso de la humanidad.
|
||||
html:
|
||||
- "<p> <b>Hola Mundo!!</b></p>"
|
||||
- "<p> <u>áéíóú</u></p>"
|
||||
- "<p>'hola Mundo!!' <script>alert('Hola Bug!!')</script></p>"
|
||||
email:
|
||||
- "davidsantos@colosa.com"
|
||||
- "juliocesar@colosa.com"
|
||||
- "mauricio@colosa.com"
|
||||
- "wilmer@colosa.com"
|
||||
address:
|
||||
- "Dom - 2453416 Dom. Padres"
|
||||
zip:
|
||||
- "00000"
|
||||
- "52412"
|
||||
501
workflow/engine/test/fixtures/firstname.txt
vendored
501
workflow/engine/test/fixtures/firstname.txt
vendored
@@ -1,501 +0,0 @@
|
||||
|
||||
Amy
|
||||
Sidney
|
||||
Matt
|
||||
Robert
|
||||
Michael
|
||||
Josh
|
||||
Lori
|
||||
Dorothy
|
||||
Tavon
|
||||
Corey
|
||||
Clarissa
|
||||
Tony
|
||||
Terry
|
||||
Arlene
|
||||
Alex
|
||||
Jim
|
||||
mike
|
||||
max
|
||||
Jacob
|
||||
Armand
|
||||
Joshua
|
||||
Ava
|
||||
Olivia
|
||||
Sophia
|
||||
William
|
||||
Christopher
|
||||
Matthew
|
||||
Samantha
|
||||
Andrew
|
||||
Joseph
|
||||
David
|
||||
Alexis
|
||||
Alyssa
|
||||
James
|
||||
Ryan
|
||||
Ella
|
||||
Sarah
|
||||
Taylor
|
||||
Lily
|
||||
Benjamin
|
||||
Nathan
|
||||
Ulices
|
||||
Grace
|
||||
Brianna
|
||||
Gavin
|
||||
Dylan
|
||||
Brandon
|
||||
Caleb
|
||||
Mason
|
||||
Angel
|
||||
Isaac
|
||||
Evan
|
||||
Jack
|
||||
Kevin
|
||||
Jose
|
||||
Isaiah
|
||||
Luke
|
||||
Landon
|
||||
Justin
|
||||
Lucas
|
||||
Zachary
|
||||
Jordan
|
||||
Arthur
|
||||
Aaron
|
||||
Brayden
|
||||
Thomas
|
||||
Cameron
|
||||
Hunter
|
||||
Austin
|
||||
Adrian
|
||||
Connor
|
||||
Owen
|
||||
Aidan
|
||||
Jason
|
||||
Julian
|
||||
Wyatt
|
||||
Charles
|
||||
Carter
|
||||
Juan
|
||||
Chase
|
||||
Diego
|
||||
Jeremiah
|
||||
Brody
|
||||
Xavier
|
||||
Adam
|
||||
Sebastian
|
||||
Haydens
|
||||
Nathaniel
|
||||
Jesus
|
||||
Ian
|
||||
Tristan
|
||||
Bryan
|
||||
Sean
|
||||
Cole
|
||||
Jennifer
|
||||
Melanie
|
||||
Gianna
|
||||
Charlotte
|
||||
Paige
|
||||
Isabel
|
||||
Gracie
|
||||
Haley
|
||||
Mya
|
||||
Michelle
|
||||
Molly
|
||||
Stephanie
|
||||
Nicole
|
||||
Jenna
|
||||
Natalia
|
||||
Sadie
|
||||
Jada
|
||||
Ruby
|
||||
Jayla
|
||||
Lydia
|
||||
Bella
|
||||
Haydden
|
||||
Miley
|
||||
Laila
|
||||
Reagan
|
||||
Collin
|
||||
Gage
|
||||
Emmanuel
|
||||
Kendall
|
||||
Liliana
|
||||
Jacqueline
|
||||
Reese
|
||||
Marissa
|
||||
Juliana
|
||||
Tanner
|
||||
Malachi
|
||||
Fernando
|
||||
Cesar
|
||||
Javier
|
||||
Miles
|
||||
Jaiden
|
||||
Edwin
|
||||
Travis
|
||||
Bryson
|
||||
Jace
|
||||
Kaiden
|
||||
Wesley
|
||||
Jeffrey
|
||||
Roman
|
||||
Brendan
|
||||
Maddox
|
||||
Donovan
|
||||
Rylan
|
||||
Dalton
|
||||
Harrison
|
||||
Andre
|
||||
Keegan
|
||||
Sawyer
|
||||
Clayton
|
||||
Zane
|
||||
Gregory
|
||||
Rafael
|
||||
Ezekiel
|
||||
Griffin
|
||||
ny
|
||||
Mateo
|
||||
Braylon
|
||||
Cash
|
||||
Maximus
|
||||
Simon
|
||||
Corbin
|
||||
Brennan
|
||||
Skylers
|
||||
Xander
|
||||
Jaxson
|
||||
Kameron
|
||||
Kyler
|
||||
Elias
|
||||
Harper
|
||||
Ivy
|
||||
Camille
|
||||
Savanna
|
||||
Emely
|
||||
Kiley
|
||||
Kailey
|
||||
Miriam
|
||||
Rihanna
|
||||
Georgia
|
||||
Harmony
|
||||
Kiera
|
||||
Monica
|
||||
Bethany
|
||||
Kaylie
|
||||
Camron
|
||||
Alice
|
||||
Maddison
|
||||
Ximena
|
||||
April
|
||||
Marely
|
||||
Julie
|
||||
Danica
|
||||
Presley
|
||||
Brielle
|
||||
Julissa
|
||||
Angie
|
||||
Hazel
|
||||
Rose
|
||||
Malia
|
||||
Shayla
|
||||
Fiona
|
||||
Phoebe
|
||||
Nayeli
|
||||
Jaya
|
||||
Ruth
|
||||
Janiya
|
||||
Denise
|
||||
Holly
|
||||
Hanna
|
||||
Tatum
|
||||
Marlee
|
||||
Nataly
|
||||
Lizbeth
|
||||
Serena
|
||||
Anya
|
||||
Jaslene
|
||||
Kaylin
|
||||
Greyson
|
||||
Jameson
|
||||
Everett
|
||||
Jayce
|
||||
Darren
|
||||
Elliott
|
||||
Uriel
|
||||
Hugo
|
||||
Marshall
|
||||
Nickolas
|
||||
Bryant
|
||||
Maurice
|
||||
Russell
|
||||
Leland
|
||||
Davis
|
||||
Reed
|
||||
Kade
|
||||
Reece
|
||||
Morgan
|
||||
Ramon
|
||||
Rocco
|
||||
Orlando
|
||||
Ryker
|
||||
Brodie
|
||||
Paxton
|
||||
Jacoby
|
||||
Macie
|
||||
Lyric
|
||||
Logan
|
||||
Lana
|
||||
Kaned
|
||||
Alvin
|
||||
Shaun
|
||||
Eddie
|
||||
Kane
|
||||
Davion
|
||||
Zachariah
|
||||
Dorian
|
||||
Kellen
|
||||
Micaela
|
||||
Isiah
|
||||
Javon
|
||||
Nasir
|
||||
Milo
|
||||
Anahi
|
||||
Alissa
|
||||
Anaya
|
||||
Ainsley
|
||||
Noelle
|
||||
Meredith
|
||||
Kailyn
|
||||
Johanna
|
||||
Evangeline
|
||||
Kathleen
|
||||
Juliet
|
||||
Meghan
|
||||
Paisley
|
||||
Athena
|
||||
Hailee
|
||||
Emilee
|
||||
Sage
|
||||
Alanna
|
||||
Elaina
|
||||
Nia
|
||||
Kasey
|
||||
Paris
|
||||
Casey
|
||||
Dana
|
||||
Aubrie
|
||||
Kaitlin
|
||||
Norah
|
||||
Lauryn
|
||||
Perla
|
||||
Amiyah
|
||||
Lillie
|
||||
Danika
|
||||
Heather
|
||||
Kassidy
|
||||
Taryn
|
||||
Tori
|
||||
Francesca
|
||||
Kristen
|
||||
Amya
|
||||
Elle
|
||||
Craig
|
||||
Ibrahim
|
||||
Osvaldo
|
||||
Wade
|
||||
Harley
|
||||
Steve
|
||||
Davin
|
||||
Deshawn
|
||||
Kason
|
||||
Damion
|
||||
Jaylon
|
||||
Jefferson
|
||||
Aron
|
||||
Brooks
|
||||
Darian
|
||||
Gerald
|
||||
Rolando
|
||||
Terrence
|
||||
Enzo
|
||||
Kian
|
||||
Ryland
|
||||
Barrett
|
||||
Jaeden
|
||||
Ben
|
||||
Bradyn
|
||||
Giovani
|
||||
Blaine
|
||||
Madden
|
||||
Jerome
|
||||
Muhamma
|
||||
Ronnie
|
||||
Layne
|
||||
Kolby
|
||||
Leonard
|
||||
Vicente
|
||||
Cale
|
||||
Alessandro
|
||||
Zachery
|
||||
Gavyn
|
||||
Aydin
|
||||
Xzavier
|
||||
Malakai
|
||||
Raphael
|
||||
Cannon
|
||||
Rudy
|
||||
Asa
|
||||
Darrell
|
||||
Giancarlo
|
||||
Elisha
|
||||
Junior
|
||||
Zackery
|
||||
Alvaro
|
||||
Lewis
|
||||
Valentin
|
||||
Deacon
|
||||
Jase
|
||||
Harry
|
||||
Rashad
|
||||
Finnegan
|
||||
Mohammed
|
||||
Ramiro
|
||||
Cedric
|
||||
Brennen
|
||||
Santino
|
||||
Stanley
|
||||
Tyrone
|
||||
Chace
|
||||
Francis
|
||||
athon
|
||||
Teagan
|
||||
Zechariah
|
||||
Alonso
|
||||
Kaeden
|
||||
Kamden
|
||||
Gilberto
|
||||
Ray
|
||||
Karter
|
||||
Luciano
|
||||
Nico
|
||||
Kole
|
||||
Aryan
|
||||
Draven
|
||||
Jamie
|
||||
Misael
|
||||
Lee
|
||||
Alexzanders
|
||||
Camren
|
||||
Giovanny
|
||||
Amare
|
||||
Rhett
|
||||
Rhys
|
||||
Rodolfo
|
||||
Nash
|
||||
Markus
|
||||
Deven
|
||||
Mohammad
|
||||
Moshe
|
||||
Quintin
|
||||
Dwayne
|
||||
Memphis
|
||||
Atticus
|
||||
Davian
|
||||
Eugene
|
||||
Jax
|
||||
Antoine
|
||||
Wayne
|
||||
Randall
|
||||
Semaj
|
||||
Uriah
|
||||
Clark
|
||||
Aidyn
|
||||
Jorden
|
||||
Maxim
|
||||
Aditya
|
||||
Lawson
|
||||
Messiah
|
||||
Korbin
|
||||
Sullivan
|
||||
Freddy
|
||||
Demarcus
|
||||
Neil
|
||||
Brice
|
||||
King
|
||||
Davon
|
||||
Elvis
|
||||
Ace
|
||||
Dexter
|
||||
Heath
|
||||
Duncan
|
||||
Jamar
|
||||
Sincere
|
||||
Irvin
|
||||
Remingtons
|
||||
Kadin
|
||||
Soren
|
||||
Tyree
|
||||
Damarion
|
||||
Talan
|
||||
Adrien
|
||||
Gilbert
|
||||
Keenan
|
||||
Darnell
|
||||
Adolfo
|
||||
Tristian
|
||||
Derick
|
||||
Isai
|
||||
Rylee
|
||||
Gauge
|
||||
Harold
|
||||
Kareem
|
||||
Deangelo
|
||||
Agustin
|
||||
Coleman
|
||||
Zavier
|
||||
Lamar
|
||||
Emery
|
||||
Jaydin
|
||||
Devan
|
||||
Jordyn
|
||||
Mathias
|
||||
Prince
|
||||
Seamus
|
||||
Jasiah
|
||||
Efrain
|
||||
Darryl
|
||||
Arjun
|
||||
Miguel
|
||||
Roland
|
||||
Conrad
|
||||
Kamron
|
||||
Hamza
|
||||
Santos
|
||||
Frankie
|
||||
Dominique
|
||||
Marley
|
||||
Vance
|
||||
Dax
|
||||
Jamir
|
||||
Kylan
|
||||
Todd
|
||||
Maximo
|
||||
Jabari
|
||||
Matthias
|
||||
Haiden
|
||||
Luka
|
||||
Marcelo
|
||||
Keon
|
||||
Layton
|
||||
Tyrell
|
||||
Kash
|
||||
Laney
|
||||
Isis
|
||||
Marcela
|
||||
Dave
|
||||
Amos
|
||||
Grover
|
||||
29
workflow/engine/test/fixtures/fixtures.yml
vendored
29
workflow/engine/test/fixtures/fixtures.yml
vendored
@@ -1,29 +0,0 @@
|
||||
-
|
||||
input: '/test'
|
||||
output: true
|
||||
comment: isPathAbsolute() returns true if path is absolute
|
||||
-
|
||||
input: '\\test'
|
||||
output: true
|
||||
comment: isPathAbsolute() returns true if path is absolute
|
||||
-
|
||||
input: 'C:\\test'
|
||||
output: true
|
||||
comment: isPathAbsolute() returns true if path is absolute
|
||||
-
|
||||
input: 'd:/test'
|
||||
output: true
|
||||
comment: isPathAbsolute() returns true if path is absolute
|
||||
-
|
||||
input: 'test'
|
||||
output: false
|
||||
comment: isPathAbsolute() returns false if path is relative
|
||||
-
|
||||
input: '../test'
|
||||
output: false
|
||||
comment: isPathAbsolute() returns false if path is relative
|
||||
-
|
||||
input: '..\\test'
|
||||
output: false
|
||||
comment: isPathAbsolute() returns false if path is relative
|
||||
|
||||
36
workflow/engine/test/fixtures/groupUser.yml
vendored
36
workflow/engine/test/fixtures/groupUser.yml
vendored
@@ -1,36 +0,0 @@
|
||||
create1:
|
||||
-
|
||||
Title: "Create the group user row"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
GRP_UID: "2"
|
||||
USR_UID: "2"
|
||||
input:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the group user row (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
GRP_UID: ""
|
||||
USR_UID: "2"
|
||||
input:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the group user row"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
GRP_UID: "2"
|
||||
USR_UID: "2"
|
||||
input:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the group user row (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
GRP_UID: "111111111111"
|
||||
USR_UID: "222222222222"
|
||||
input:
|
||||
Type: "Exception"
|
||||
32
workflow/engine/test/fixtures/groups.txt
vendored
32
workflow/engine/test/fixtures/groups.txt
vendored
@@ -1,32 +0,0 @@
|
||||
Marketing Users
|
||||
Operators
|
||||
Accounters
|
||||
Lawyers
|
||||
Operators
|
||||
Salespersons
|
||||
Team A
|
||||
Team B
|
||||
Team C
|
||||
Team D
|
||||
Team E
|
||||
Team F
|
||||
Team G
|
||||
Team H
|
||||
Team I
|
||||
Team J
|
||||
Team K
|
||||
Team L
|
||||
Team M
|
||||
Team N
|
||||
Team O
|
||||
Team P
|
||||
Team Q
|
||||
Team R
|
||||
Team S
|
||||
Team T
|
||||
Team U
|
||||
Team V
|
||||
Team W
|
||||
Team X
|
||||
Team Y
|
||||
Team Z
|
||||
88
workflow/engine/test/fixtures/inputDocument.yml
vendored
88
workflow/engine/test/fixtures/inputDocument.yml
vendored
@@ -1,88 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the input document data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
INP_DOC_UID: "1"
|
||||
input:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the input document data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
INP_DOC_UID: "111111111111"
|
||||
input:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the input document data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
INP_DOC_UID: "2"
|
||||
PRO_UID: "2"
|
||||
INP_DOC_FORM_NEEDED: "VREAL"
|
||||
INP_DOC_ORIGINAL: "ORIGINAL"
|
||||
INP_DOC_PUBLISHED: "PUBLIC"
|
||||
INP_DOC_TITLE: "INP_DOC_TITLE"
|
||||
INP_DOC_DESCRIPTION: "INP_DOC_DESCRIPTION"
|
||||
input:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the input document data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
INP_DOC_UID: ""
|
||||
PRO_UID: "2"
|
||||
INP_DOC_FORM_NEEDED: "VREAL"
|
||||
INP_DOC_ORIGINAL: "ORIGINAL"
|
||||
INP_DOC_PUBLISHED: "PUBLIC"
|
||||
INP_DOC_TITLE: "INP_DOC_TITLE"
|
||||
INP_DOC_DESCRIPTION: "INP_DOC_DESCRIPTION"
|
||||
input:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the input document data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
INP_DOC_UID: "1"
|
||||
PRO_UID: "2"
|
||||
INP_DOC_FORM_NEEDED: "VREAL"
|
||||
INP_DOC_ORIGINAL: "ORIGINAL"
|
||||
INP_DOC_PUBLISHED: "PUBLIC"
|
||||
INP_DOC_TITLE: "INP_DOC_TITLE1"
|
||||
INP_DOC_DESCRIPTION: "INP_DOC_DESCRIPTION1"
|
||||
input:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the input document data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
INP_DOC_UID: "111111111111"
|
||||
PRO_UID: "2"
|
||||
INP_DOC_FORM_NEEDED: "VREAL"
|
||||
INP_DOC_ORIGINAL: "ORIGINAL"
|
||||
INP_DOC_PUBLISHED: "PUBLIC"
|
||||
INP_DOC_TITLE: "INP_DOC_TITLE1"
|
||||
INP_DOC_DESCRIPTION: "INP_DOC_DESCRIPTION1"
|
||||
input:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the input document data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
INP_DOC_UID: "2"
|
||||
input:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the input document data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
INP_DOC_UID: "111111111111"
|
||||
input:
|
||||
Type: "Exception"
|
||||
222
workflow/engine/test/fixtures/lastname.txt
vendored
222
workflow/engine/test/fixtures/lastname.txt
vendored
@@ -1,222 +0,0 @@
|
||||
Agnes
|
||||
Ahearn
|
||||
Amadon
|
||||
Anderson
|
||||
Arbouet
|
||||
Arinello
|
||||
Austin
|
||||
Balisi
|
||||
barkle
|
||||
Barrett
|
||||
Basili
|
||||
Beam
|
||||
Beccia
|
||||
Bechtel
|
||||
Bendis
|
||||
Bittner
|
||||
Bittner
|
||||
Black
|
||||
Blackshear
|
||||
Boria
|
||||
Bosworth
|
||||
Bourgeous
|
||||
Broderick
|
||||
Brown
|
||||
Brule
|
||||
Burns
|
||||
Cagley
|
||||
Champagne
|
||||
Charette
|
||||
Ching
|
||||
Ciarleglio
|
||||
Cifrino
|
||||
Cifuni
|
||||
Cleveland
|
||||
Cole
|
||||
Connelly
|
||||
Connolly
|
||||
Corleone
|
||||
Cook
|
||||
Corey
|
||||
Corey
|
||||
Cowell
|
||||
Creelman
|
||||
Cremins
|
||||
Crowley
|
||||
Daley
|
||||
Debrosse
|
||||
Debrosse-Saint-Louis
|
||||
Deleskey
|
||||
Demers
|
||||
Dempsey
|
||||
Diehl
|
||||
Dobbie
|
||||
Dockstader
|
||||
Doe
|
||||
Downey
|
||||
Dribin
|
||||
Ducharme
|
||||
Duphily
|
||||
Eckstein
|
||||
Ericson
|
||||
Evans
|
||||
Fabel
|
||||
Farrell
|
||||
Favreau
|
||||
Favreau
|
||||
Foley
|
||||
Follett
|
||||
Forrest
|
||||
Gack
|
||||
Galorath
|
||||
Garmus
|
||||
Gehly
|
||||
Gendron
|
||||
Gladney
|
||||
Glanville
|
||||
Goldsmith
|
||||
Gottesdiener
|
||||
Grealish
|
||||
Haaigis
|
||||
Hacker
|
||||
Hacker-LeCount
|
||||
Haddad
|
||||
Haigis
|
||||
Hamel
|
||||
Harrington
|
||||
Henderson
|
||||
Hennessey
|
||||
Herron
|
||||
Hessmiller
|
||||
Hill
|
||||
Hillier
|
||||
Hobbs
|
||||
Hobbs
|
||||
Hobbs
|
||||
Ierardi
|
||||
Isaacs
|
||||
Jones
|
||||
Kappelman
|
||||
Karem
|
||||
Karten
|
||||
Keith
|
||||
Kelly
|
||||
Kenny
|
||||
Killilea
|
||||
Krasner
|
||||
LaFrance
|
||||
Lawhorn
|
||||
Layman
|
||||
LeBlanc
|
||||
Legarz
|
||||
Leo
|
||||
Leonard
|
||||
Lewis
|
||||
Lokinger
|
||||
Lovering
|
||||
Lusk
|
||||
MacDonald
|
||||
Maciewicz
|
||||
Maguire
|
||||
Mahoney
|
||||
Mariani
|
||||
McCarthy
|
||||
McCauley
|
||||
McDonald
|
||||
McGarry
|
||||
McMahon
|
||||
Menard
|
||||
Minkiewicz
|
||||
Moe
|
||||
Morrison
|
||||
Motyka
|
||||
Murphy
|
||||
Nemes
|
||||
Newman
|
||||
Newman
|
||||
Nickels
|
||||
Nye
|
||||
Nyman
|
||||
OConnor
|
||||
Orr
|
||||
Palmer-Erbs
|
||||
Palmieri
|
||||
Panagiotes
|
||||
Parker
|
||||
Parks
|
||||
Parks
|
||||
Pelletier
|
||||
PelletierRutkowski
|
||||
Penn
|
||||
Peters
|
||||
Pfannkoch
|
||||
Pinchera
|
||||
Planansky
|
||||
Plasse
|
||||
Poillucci
|
||||
Pomerleau
|
||||
Potter
|
||||
Powers
|
||||
Primas
|
||||
Pritchard
|
||||
Quenga
|
||||
Rancourt
|
||||
Rearick
|
||||
Reifer
|
||||
Rice
|
||||
rogers
|
||||
Rooney
|
||||
Rosoff
|
||||
Roy
|
||||
Ruhe
|
||||
Russac
|
||||
Russell
|
||||
Ryan
|
||||
Sahely
|
||||
Sak
|
||||
Salvaggio
|
||||
Santiano
|
||||
Sassenburg
|
||||
Scanlon
|
||||
Schall
|
||||
Scopetski
|
||||
Searfos
|
||||
Sergio
|
||||
Sergio
|
||||
Shapiro
|
||||
Sharpe
|
||||
Silck
|
||||
Silveri
|
||||
Simmons
|
||||
Simons
|
||||
Skirvin-Leclair
|
||||
Smalarz
|
||||
Smith
|
||||
Smith-Burke
|
||||
Sullivan
|
||||
Swansburg
|
||||
Sweeney
|
||||
Talley
|
||||
Taylor
|
||||
Tebbetts
|
||||
Thaxton
|
||||
Tiberio
|
||||
tillman
|
||||
Tilton(Cuttino)
|
||||
Toronto
|
||||
Tull
|
||||
Vernon
|
||||
VonHalle
|
||||
Walendziewicz
|
||||
Walker
|
||||
Walsh
|
||||
Wei
|
||||
Welsh
|
||||
Wiegers
|
||||
Wilkins
|
||||
Williams
|
||||
Wright
|
||||
Wyron
|
||||
Young
|
||||
Yourdon
|
||||
Zentis
|
||||
84
workflow/engine/test/fixtures/outputDocument.yml
vendored
84
workflow/engine/test/fixtures/outputDocument.yml
vendored
@@ -1,84 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the output document data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "1"
|
||||
Output:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the output document data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the output document data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "2"
|
||||
PRO_UID: "2"
|
||||
OUT_DOC_TITLE: "OUT_DOC_TITLE"
|
||||
OUT_DOC_DESCRIPTION: "OUT_DOC_DESCRIPTION"
|
||||
OUT_DOC_FILENAME: "OUT_DOC_FILENAME"
|
||||
OUT_DOC_TEMPLATE: "OUT_DOC_TEMPLATE"
|
||||
Output:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the output document data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
OUT_DOC_UID: ""
|
||||
PRO_UID: "2"
|
||||
OUT_DOC_TITLE: "OUT_DOC_TITLE"
|
||||
OUT_DOC_DESCRIPTION: "OUT_DOC_DESCRIPTION"
|
||||
OUT_DOC_FILENAME: "OUT_DOC_FILENAME"
|
||||
OUT_DOC_TEMPLATE: "OUT_DOC_TEMPLATE"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the output document data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "1"
|
||||
PRO_UID: "2"
|
||||
OUT_DOC_TITLE: "OUT_DOC_TITLE1"
|
||||
OUT_DOC_DESCRIPTION: "OUT_DOC_DESCRIPTION1"
|
||||
OUT_DOC_FILENAME: "OUT_DOC_FILENAME1"
|
||||
OUT_DOC_TEMPLATE: "OUT_DOC_TEMPLATE1"
|
||||
Output:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the output document data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "111111111111"
|
||||
PRO_UID: "2"
|
||||
OUT_DOC_TITLE: "OUT_DOC_TITLE1"
|
||||
OUT_DOC_DESCRIPTION: "OUT_DOC_DESCRIPTION1"
|
||||
OUT_DOC_FILENAME: "OUT_DOC_FILENAME1"
|
||||
OUT_DOC_TEMPLATE: "OUT_DOC_TEMPLATE1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the output document data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "2"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the output document data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
OUT_DOC_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
494
workflow/engine/test/fixtures/processMap.yml
vendored
494
workflow/engine/test/fixtures/processMap.yml
vendored
@@ -1,494 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the processmap data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "string"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the processmap data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
createProcess1:
|
||||
-
|
||||
Title: "Create a process"
|
||||
Function: "createProcessTest"
|
||||
Input:
|
||||
USR_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
updateProcess1:
|
||||
-
|
||||
Title: "Update a process"
|
||||
Function: "updateProcessTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
PRO_TITLE_X: 100
|
||||
PRO_TITLE_Y: 100
|
||||
Output:
|
||||
Type: "integer"
|
||||
updateProcess2:
|
||||
-
|
||||
Title: "Update a process (not existent)"
|
||||
Function: "updateProcessTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
PRO_TITLE_X: 100
|
||||
PRO_TITLE_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
editProcess1:
|
||||
-
|
||||
Title: "Edit the process info"
|
||||
Function: "editProcessTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
editProcess2:
|
||||
-
|
||||
Title: "Edit the process info (not existent)"
|
||||
Function: "editProcessTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
saveTitlePosition1:
|
||||
-
|
||||
Title: "Save the title position"
|
||||
Function: "saveTitlePositionTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
PRO_X: 100
|
||||
PRO_Y: 100
|
||||
Output:
|
||||
Type: "boolean"
|
||||
saveTitlePosition2:
|
||||
-
|
||||
Title: "Save the title position (not existent)"
|
||||
Function: "saveTitlePositionTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
PRO_X: 100
|
||||
PRO_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
steps1:
|
||||
-
|
||||
Title: "Show the task steps"
|
||||
Function: "stepsTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
steps2:
|
||||
-
|
||||
Title: "Show the task steps (not existent)"
|
||||
Function: "stepsTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
users1:
|
||||
-
|
||||
Title: "Show the task users"
|
||||
Function: "usersTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
users2:
|
||||
-
|
||||
Title: "Show the task users (not existent)"
|
||||
Function: "usersTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
stepsConditions1:
|
||||
-
|
||||
Title: "Show the step conditions of the task"
|
||||
Function: "stepsConditionsTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
stepsConditions2:
|
||||
-
|
||||
Title: "Show the step conditions of the task (not existent)"
|
||||
Function: "stepsConditionsTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
stepsTriggers1:
|
||||
-
|
||||
Title: "Show the step triggers of the task"
|
||||
Function: "stepsTriggersTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
stepsTriggers2:
|
||||
-
|
||||
Title: "Show the step triggers of the task (not existent)"
|
||||
Function: "stepsTriggersTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
addTask1:
|
||||
-
|
||||
Title: "Add a task to process"
|
||||
Function: "addTaskTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "boolean"
|
||||
addTask2:
|
||||
-
|
||||
Title: "Add a task to process (not existent)"
|
||||
Function: "addTaskTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
editTaskProperties1:
|
||||
-
|
||||
Title: "Edit the task properties"
|
||||
Function: "editTaskPropertiesTest"
|
||||
Input:
|
||||
TAS_UID: "1"
|
||||
iForm: 1
|
||||
iIndex: 0
|
||||
Output:
|
||||
Type: "boolean"
|
||||
editTaskProperties2:
|
||||
-
|
||||
Title: "Edit the task properties (not existent)"
|
||||
Function: "editTaskPropertiesTest"
|
||||
Input:
|
||||
TAS_UID: "111111111111"
|
||||
iForm: 1
|
||||
iIndex: 0
|
||||
Output:
|
||||
Type: "Exception"
|
||||
saveTaskPosition1:
|
||||
-
|
||||
Title: "Save the task position"
|
||||
Function: "saveTaskPositionTest"
|
||||
Input:
|
||||
TAS_UID: "1"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "integer"
|
||||
saveTaskPosition2:
|
||||
-
|
||||
Title: "Save the task position (not existent)"
|
||||
Function: "saveTaskPositionTest"
|
||||
Input:
|
||||
TAS_UID: "111111111111"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
deleteTask1:
|
||||
-
|
||||
Title: "Delete a task"
|
||||
Function: "deleteTaskTest"
|
||||
Input:
|
||||
TAS_UID: "1"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "boolean"
|
||||
deleteTask2:
|
||||
-
|
||||
Title: "Delete a task (not existent)"
|
||||
Function: "deleteTaskTest"
|
||||
Input:
|
||||
TAS_UID: "111111111111"
|
||||
TAS_X: 100
|
||||
TAS_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
addGuide1:
|
||||
-
|
||||
Title: "Add a new guide"
|
||||
Function: "addGuideTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
iPosition: 100
|
||||
sDirection: "vertical"
|
||||
Output:
|
||||
Type: "string"
|
||||
addGuide2:
|
||||
-
|
||||
Title: "Add a new guide (not existent)"
|
||||
Function: "addGuideTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
iPosition: 100
|
||||
sDirection: "vertical"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
saveGuidePosition1:
|
||||
-
|
||||
Title: "Save de guide position"
|
||||
Function: "saveGuidePositionTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
iPosition: 100
|
||||
sDirection: "vertical"
|
||||
Output:
|
||||
Type: "integer"
|
||||
saveGuidePosition2:
|
||||
-
|
||||
Title: "Save de guide position (not existent)"
|
||||
Function: "saveGuidePositionTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
iPosition: 100
|
||||
sDirection: "vertical"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
deleteGuide1:
|
||||
-
|
||||
Title: "Delete a guide"
|
||||
Function: "deleteGuideTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
deleteGuide2:
|
||||
-
|
||||
Title: "Delete a guide (not existent)"
|
||||
Function: "deleteGuideTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
deleteGuides1:
|
||||
-
|
||||
Title: "Delete all guides"
|
||||
Function: "deleteGuidesTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
deleteGuides2:
|
||||
-
|
||||
Title: "Delete all guides (not existent)"
|
||||
Function: "deleteGuidesTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
updateText1:
|
||||
-
|
||||
Title: "Update a text"
|
||||
Function: "updateTextTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
SWI_TEXT: "text1"
|
||||
Output:
|
||||
Type: "integer"
|
||||
updateText2:
|
||||
-
|
||||
Title: "Update a text (not existent)"
|
||||
Function: "updateTextTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
SWI_TEXT: "text1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
saveTextPosition1:
|
||||
-
|
||||
Title: "Update a text position"
|
||||
Function: "saveTextPositionTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
SWI_X: 100
|
||||
SWI_Y: 100
|
||||
Output:
|
||||
Type: "integer"
|
||||
saveTextPosition2:
|
||||
-
|
||||
Title: "Update a text position (not existent)"
|
||||
Function: "saveTextPositionTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
SWI_X: 100
|
||||
SWI_Y: 100
|
||||
Output:
|
||||
Type: "Exception"
|
||||
deleteText1:
|
||||
-
|
||||
Title: "Delete a text"
|
||||
Function: "deleteTextTest"
|
||||
Input:
|
||||
SWI_UID: "2"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
deleteText2:
|
||||
-
|
||||
Title: "Delete a text (not existent)"
|
||||
Function: "deleteTextTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
dynaformsList1:
|
||||
-
|
||||
Title: "Show the dynaforms list"
|
||||
Function: "dynaformsListTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
dynaformsList2:
|
||||
-
|
||||
Title: "Show the dynaforms list (not existent)"
|
||||
Function: "dynaformsListTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
outputdocsList1:
|
||||
-
|
||||
Title: "Show the output documents list"
|
||||
Function: "outputdocsListTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
outputdocsList2:
|
||||
-
|
||||
Title: "Show the output documents list (not existent)"
|
||||
Function: "outputdocsListTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
inputdocsList1:
|
||||
-
|
||||
Title: "Show the input documents list"
|
||||
Function: "inputdocsListTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
inputdocsList2:
|
||||
-
|
||||
Title: "Show the input documents list (not existent)"
|
||||
Function: "inputdocsListTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
triggersList1:
|
||||
-
|
||||
Title: "Show the triggers list"
|
||||
Function: "triggersListTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
triggersList2:
|
||||
-
|
||||
Title: "Show the triggers list (not existent)"
|
||||
Function: "triggersListTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
messagesList1:
|
||||
-
|
||||
Title: "Show the messages list"
|
||||
Function: "messagesListTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
messagesList2:
|
||||
-
|
||||
Title: "Show the messages list (not existent)"
|
||||
Function: "messagesListTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
currentPattern1:
|
||||
-
|
||||
Title: "Show the current pattern"
|
||||
Function: "currentPatternTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
currentPattern2:
|
||||
-
|
||||
Title: "Show the current pattern (not existent)"
|
||||
Function: "currentPatternTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
newPattern1:
|
||||
-
|
||||
Title: "New pattern"
|
||||
Function: "newPatternTest"
|
||||
Input:
|
||||
PRO_UID: "1"
|
||||
TAS_UID: "1"
|
||||
ROU_NEXT_TASK: "2"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
newPattern2:
|
||||
-
|
||||
Title: "New pattern (not existent)"
|
||||
Function: "newPatternTest"
|
||||
Input:
|
||||
PRO_UID: "111111111111"
|
||||
TAS_UID: "1"
|
||||
ROU_NEXT_TASK: "2"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
deleteDerivation1:
|
||||
-
|
||||
Title: "Delete a derivation rule"
|
||||
Function: "deleteDerivationTest"
|
||||
Input:
|
||||
TAS_UID: "1"
|
||||
Output:
|
||||
Type: "boolean"
|
||||
deleteDerivation2:
|
||||
-
|
||||
Title: "Delete a derivation rule (not existent)"
|
||||
Function: "deleteDerivationTest"
|
||||
Input:
|
||||
TAS_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
112
workflow/engine/test/fixtures/route.yml
vendored
112
workflow/engine/test/fixtures/route.yml
vendored
@@ -1,112 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the route data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
ROU_UID: "1"
|
||||
Output:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the route data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
ROU_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the route data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
ROU_UID: "2"
|
||||
ROU_PARENT: ""
|
||||
PRO_UID: "2"
|
||||
TAS_UID: "2"
|
||||
ROU_NEXT_TAK: "2"
|
||||
ROU_CASE: "0"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
ROU_CONDITION: ""
|
||||
ROU_TO_LAST_USER: "FALSE"
|
||||
ROU_OPTIONAL: "FALSE"
|
||||
ROU_SEND_EMAIL: "TRUE"
|
||||
ROU_SOURCEANCHOR: "1"
|
||||
ROU_TARGETANCHOR: "0"
|
||||
Output:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the route data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
ROU_UID: ""
|
||||
ROU_PARENT: ""
|
||||
PRO_UID: "2"
|
||||
TAS_UID: "2"
|
||||
ROU_NEXT_TAK: "2"
|
||||
ROU_CASE: "0"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
ROU_CONDITION: ""
|
||||
ROU_TO_LAST_USER: "FALSE"
|
||||
ROU_OPTIONAL: "FALSE"
|
||||
ROU_SEND_EMAIL: "TRUE"
|
||||
ROU_SOURCEANCHOR: "1"
|
||||
ROU_TARGETANCHOR: "0"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the route data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
ROU_UID: "1"
|
||||
ROU_PARENT: ""
|
||||
PRO_UID: "2"
|
||||
TAS_UID: "2"
|
||||
ROU_NEXT_TAK: "2"
|
||||
ROU_CASE: "0"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
ROU_CONDITION: ""
|
||||
ROU_TO_LAST_USER: "FALSE"
|
||||
ROU_OPTIONAL: "FALSE"
|
||||
ROU_SEND_EMAIL: "TRUE"
|
||||
ROU_SOURCEANCHOR: "1"
|
||||
ROU_TARGETANCHOR: "0"
|
||||
Output:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the route data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
ROU_UID: "111111111111"
|
||||
ROU_PARENT: ""
|
||||
PRO_UID: "2"
|
||||
TAS_UID: "2"
|
||||
ROU_NEXT_TAK: "2"
|
||||
ROU_CASE: "0"
|
||||
ROU_TYPE: "SEQUENTIAL"
|
||||
ROU_CONDITION: ""
|
||||
ROU_TO_LAST_USER: "FALSE"
|
||||
ROU_OPTIONAL: "FALSE"
|
||||
ROU_SEND_EMAIL: "TRUE"
|
||||
ROU_SOURCEANCHOR: "1"
|
||||
ROU_TARGETANCHOR: "0"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the route data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
ROU_UID: "2"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the route data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
ROU_UID: "111111111111"
|
||||
Output:
|
||||
Type: "Exception"
|
||||
35
workflow/engine/test/fixtures/step.yml
vendored
35
workflow/engine/test/fixtures/step.yml
vendored
@@ -1,35 +0,0 @@
|
||||
CreateTestSteps:
|
||||
-
|
||||
Title:"Creating new Steps"
|
||||
Function:"CreateStep"
|
||||
Input:
|
||||
PRO_UID[]:"guid.pm"
|
||||
TAS_UID[]:"guid.pm"
|
||||
Output:
|
||||
Value: 1
|
||||
StepUnitTest:
|
||||
-
|
||||
Title:"Updating Steps"
|
||||
Function:"UpdateStep"
|
||||
Input:
|
||||
STEP_UID[]:"*.CREATED"
|
||||
PRO_UID[]:"guid.pm"
|
||||
TAS_UID[]:"guid.pm"
|
||||
STEP_OBJ_UID[]:"stepUidObj.pm"
|
||||
STEP_POSITION[]:"rand.number"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Steps"
|
||||
Function:"LoadStep"
|
||||
Input:
|
||||
STEP_UID[]:"*.CREATED"
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Steps"
|
||||
Function:"RemoveStep"
|
||||
Input:
|
||||
STEP_UID[]:"*.CREATED"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
43
workflow/engine/test/fixtures/stepTrigger.yml
vendored
43
workflow/engine/test/fixtures/stepTrigger.yml
vendored
@@ -1,43 +0,0 @@
|
||||
CreateTestSteps:
|
||||
-
|
||||
Title:"Creating new Steps"
|
||||
Function:"CreateStep"
|
||||
Input:
|
||||
STEP_UID[]:"guid.pm"
|
||||
TAS_UID[]:"guid.pm"
|
||||
TRI_UID[]:"guid.pm"
|
||||
ST_TYPE:"Step Type"
|
||||
Output:
|
||||
Value: 1
|
||||
StepUnitTest:
|
||||
-
|
||||
Title:"Updating Steps"
|
||||
Function:"UpdateStep"
|
||||
Input:
|
||||
STEP_UID[]:"CREATED"
|
||||
TAS_UID[]:"CREATED_TAS"
|
||||
TRI_UID[]:"CREATED_TRI"
|
||||
ST_TYPE[]:"CREATED_TYPE"
|
||||
ST_CONDITION[]:"*.text.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Steps"
|
||||
Function:"LoadStep"
|
||||
Input:
|
||||
STEP_UID[]:"CREATED"
|
||||
TAS_UID[]:"CREATED_TAS"
|
||||
TRI_UID[]:"CREATED_TRI"
|
||||
ST_TYPE[]:"CREATED_TYPE"
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Steps"
|
||||
Function:"RemoveStep"
|
||||
Input:
|
||||
STEP_UID[]:"CREATED"
|
||||
TAS_UID[]:"CREATED_TAS"
|
||||
TRI_UID[]:"CREATED_TRI"
|
||||
ST_TYPE[]:"CREATED_TYPE"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
@@ -1,84 +0,0 @@
|
||||
load1:
|
||||
-
|
||||
Title: "Obtain the swimlane element data"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
input:
|
||||
Type: "array"
|
||||
load2:
|
||||
-
|
||||
Title: "Obtain the swimlane element data (not existent)"
|
||||
Function: "loadTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
input:
|
||||
Type: "Exception"
|
||||
create1:
|
||||
-
|
||||
Title: "Create the swimlane element data"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
SWI_UID: "2"
|
||||
PRO_UID: "2"
|
||||
SWI_TYPE: "LINE"
|
||||
SWI_X: "100"
|
||||
SWI_Y: "0"
|
||||
SWI_TEXT: "SWI_TEXT"
|
||||
input:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the swimlane element data (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
SWI_UID: ""
|
||||
PRO_UID: "2"
|
||||
SWI_TYPE: "LINE"
|
||||
SWI_X: "100"
|
||||
SWI_Y: "0"
|
||||
SWI_TEXT: "SWI_TEXT"
|
||||
input:
|
||||
Type: "Exception"
|
||||
update1:
|
||||
-
|
||||
Title: "Update the swimlane element data"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
SWI_UID: "1"
|
||||
PRO_UID: "2"
|
||||
SWI_TYPE: "LINE"
|
||||
SWI_X: "100"
|
||||
SWI_Y: "0"
|
||||
SWI_TEXT: "SWI_TEXT1"
|
||||
input:
|
||||
Type: "integer"
|
||||
update2:
|
||||
-
|
||||
Title: "Update the swimlane element data (not existent)"
|
||||
Function: "updateTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
PRO_UID: "2"
|
||||
SWI_TYPE: "LINE"
|
||||
SWI_X: "100"
|
||||
SWI_Y: "0"
|
||||
SWI_TEXT: "SWI_TEXT1"
|
||||
input:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the swimlane element data"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
SWI_UID: "2"
|
||||
input:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the swimlane element data (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
SWI_UID: "111111111111"
|
||||
input:
|
||||
Type: "Exception"
|
||||
32
workflow/engine/test/fixtures/task.yml
vendored
32
workflow/engine/test/fixtures/task.yml
vendored
@@ -1,32 +0,0 @@
|
||||
CreateTestTasks:
|
||||
-
|
||||
Title:"Creating new tasks"
|
||||
Function:"CreateTask"
|
||||
Input:
|
||||
PRO_UID[]:"guid.pm"
|
||||
Output:
|
||||
Value: 1
|
||||
TaskUnitTest:
|
||||
-
|
||||
Title:"Updating tasks"
|
||||
Function:"UpdateTask"
|
||||
Input:
|
||||
TAS_UID[]: "*.CREATED"
|
||||
TAS_DESCRIPTION[]: "text.es"
|
||||
TAS_TITLE[]: "*.html.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading tasks"
|
||||
Function:"LoadTask"
|
||||
Input:
|
||||
TAS_UID[]: "*.CREATED"
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing tasks"
|
||||
Function:"RemoveTask"
|
||||
Input:
|
||||
TAS_UID[]: "*.CREATED"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
44
workflow/engine/test/fixtures/taskUser.yml
vendored
44
workflow/engine/test/fixtures/taskUser.yml
vendored
@@ -1,44 +0,0 @@
|
||||
create1:
|
||||
-
|
||||
Title: "Create the group user row"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
TAS_UID: "2"
|
||||
USR_UID: "2"
|
||||
TU_TYPE: "2"
|
||||
TU_RELATION: "2"
|
||||
input:
|
||||
Type: "integer"
|
||||
create2:
|
||||
-
|
||||
Title: "Create the group user row (whit incomplete data)"
|
||||
Function: "createTest"
|
||||
Input:
|
||||
TAS_UID: ""
|
||||
USR_UID: "2"
|
||||
TU_TYPE: "2"
|
||||
TU_RELATION: "2"
|
||||
input:
|
||||
Type: "Exception"
|
||||
remove1:
|
||||
-
|
||||
Title: "Remove the group user row"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
TAS_UID: "2"
|
||||
USR_UID: "2"
|
||||
TU_TYPE: "2"
|
||||
TU_RELATION: "2"
|
||||
input:
|
||||
Type: "NULL"
|
||||
remove2:
|
||||
-
|
||||
Title: "Remove the group user row (not existent)"
|
||||
Function: "removeTest"
|
||||
Input:
|
||||
TAS_UID: "111111111111"
|
||||
USR_UID: "2"
|
||||
TU_TYPE: "2"
|
||||
TU_RELATION: "2"
|
||||
input:
|
||||
Type: "Exception"
|
||||
32
workflow/engine/test/fixtures/trigger.yml
vendored
32
workflow/engine/test/fixtures/trigger.yml
vendored
@@ -1,32 +0,0 @@
|
||||
CreateTestTriggers:
|
||||
-
|
||||
Title:"Creating new Triggers"
|
||||
Function:"CreateTrigger"
|
||||
Input:
|
||||
PRO_UID[]:"guid.pm"
|
||||
Output:
|
||||
Value: 1
|
||||
TriggerUnitTest:
|
||||
-
|
||||
Title:"Updating Triggers"
|
||||
Function:"UpdateTrigger"
|
||||
Input:
|
||||
TRI_UID[]:"*.CREATED"
|
||||
TRI_TITLE[]:"first.name.es"
|
||||
TRI_DESCRIPTION[]:"*.text.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Triggers"
|
||||
Function:"LoadTrigger"
|
||||
Input:
|
||||
TRI_UID[]:"*.CREATED"
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Triggers"
|
||||
Function:"RemoveTrigger"
|
||||
Input:
|
||||
TRI_UID[]:"*.CREATED"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
34
workflow/engine/test/fixtures/user.yml
vendored
34
workflow/engine/test/fixtures/user.yml
vendored
@@ -1,34 +0,0 @@
|
||||
CreateTestUsers:
|
||||
-
|
||||
Title:"Creating new Users"
|
||||
Function:"CreateUser"
|
||||
Input:
|
||||
USR_UID[]:"guid.pm"
|
||||
Output:
|
||||
Value: 1
|
||||
UserUnitTest:
|
||||
-
|
||||
Title:"Updating Users"
|
||||
Function:"UpdateUser"
|
||||
Input:
|
||||
USR_UID[]: "*.CREATED"
|
||||
USR_EMAIL[]: "*.email.es"
|
||||
USR_USRNAME[]: "first.name.es"
|
||||
USR_FIRSTNAME[]: "first.name.es"
|
||||
USR_LASTNAME[]: "last.name.es"
|
||||
Output:
|
||||
Value: 1
|
||||
-
|
||||
Title:"Loading Users"
|
||||
Function:"LoadUser"
|
||||
Input:
|
||||
USR_UID[]: "*.CREATED"
|
||||
Output:
|
||||
Type: "array"
|
||||
-
|
||||
Title:"Removing Users"
|
||||
Function:"RemoveUser"
|
||||
Input:
|
||||
USR_UID[]: "*.CREATED"
|
||||
Output:
|
||||
Type: "NULL"
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDBConnectionTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
global $G_ENVIRONMENTS;
|
||||
$counter =1;
|
||||
$testItems = 0;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}else
|
||||
include ( $dbfile );
|
||||
}else
|
||||
exit (201);
|
||||
require_once( PATH_GULLIVER . 'class.dbconnection.php');
|
||||
$obj = new DBConnection();
|
||||
$method = array ( );
|
||||
$methods = get_class_methods('DBConnection');
|
||||
|
||||
$t = new lime_test( 20 , new lime_output_color());
|
||||
$t->diag('class DBConnection' );
|
||||
|
||||
/* Listing Method */
|
||||
$t->is( count( $methods ) , 8, "class DBConnection " . 8 . " methods." );
|
||||
$t->todo ( 'Listing Method' );
|
||||
$t->is( $methods[0] , 'DBConnection', $counter++.' DBConnection');
|
||||
$t->is( $methods[1] , 'Reset' , $counter++.' Reset');
|
||||
$t->is( $methods[2] , 'Free' , $counter++.' Free');
|
||||
$t->is( $methods[3] , 'Close' , $counter++.' Close');
|
||||
$t->is( $methods[4] , 'logError' , $counter++.' logError');
|
||||
$t->is( $methods[5] , 'traceError' , $counter++.' traceError');
|
||||
$t->is( $methods[6] , 'printArgs' , $counter++.' printArgs');
|
||||
$t->is( $methods[7] , 'GetLastID' , $counter++.' GetLastID');
|
||||
|
||||
/* checking methods */
|
||||
$t->todo( 'checking methods' );
|
||||
$t->can_ok( $obj, 'DBConnection', 'DBConnection()');
|
||||
$t->can_ok( $obj, 'Reset' , 'Reset()');
|
||||
$t->can_ok( $obj, 'Free' , 'Free()');
|
||||
$t->can_ok( $obj, 'Close' , 'Close()');
|
||||
$t->can_ok( $obj, 'logError' , 'logError()');
|
||||
$t->can_ok( $obj, 'traceError' , 'traceError()');
|
||||
$t->can_ok( $obj, 'printArgs' , 'printArgs()');
|
||||
$t->can_ok( $obj, 'GetLastID' , 'GetLastID()');
|
||||
$t->todo ( 'Review, specific examples.');
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDBRecordsetTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
require_once( PATH_GULLIVER . 'class.dbconnection.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbsession.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbrecordset.php');
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc);
|
||||
$dset = $ses->Execute ( "SELECT * from APPLICATION" );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('DBRecordSet');
|
||||
$t = new lime_test( 8, new lime_output_color());
|
||||
|
||||
$t->diag('class DBRecordset' );
|
||||
$t->is( count($methods) , 6, "class G " . count($methods) . " methods." );
|
||||
$t->isa_ok( $dset , 'DBRecordSet' , 'class DBRecordset created');
|
||||
$t->can_ok( $dset , 'SetTo' , 'SetTo()' );
|
||||
$t->can_ok( $dset , 'Free' , 'Free()' );
|
||||
$t->can_ok( $dset , 'Count' , 'Count()' );
|
||||
$t->can_ok( $dset , 'Read' , 'Read()' );
|
||||
$t->can_ok( $dset , 'ReadAbsolute', 'ReadAbsolute()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDBSessionTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
require_once( PATH_GULLIVER . 'class.dbconnection.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbsession.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbrecordset.php');
|
||||
$counter =1;
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc);
|
||||
$dset = $ses->Execute ( "SELECT * from APPLICATION" );
|
||||
$method = array( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('DBSession');
|
||||
$t = new lime_test(8, new lime_output_color());
|
||||
|
||||
$t->diag('class DBSession' );
|
||||
$t->is( count($methods) , 5, "class classDBSession " . 5 . " methods." );
|
||||
$t->isa_ok( $ses , 'DBSession', 'class DBSession created');
|
||||
|
||||
$t->can_ok( $ses, 'DBSession', $counter++.' DBSession()');
|
||||
$t->can_ok( $ses, 'setTo', $counter++.' Free()');
|
||||
$t->can_ok( $ses, 'UseDB', $counter++.' UseDB()');
|
||||
$t->can_ok( $ses, 'Execute', $counter++.' Execute()');
|
||||
$t->can_ok( $ses, 'Free', $counter++.' Free()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDBTableTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}else
|
||||
include ( $dbfile );
|
||||
}else
|
||||
exit (201);
|
||||
|
||||
require_once( PATH_GULLIVER . 'class.dbconnection.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbsession.php');
|
||||
require_once( PATH_GULLIVER . 'class.dbtable.php');
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc);
|
||||
$obj = new DBTable ( $dbc, "APPLICATION" , array ( 'APP_UID' ) );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('DBTable');
|
||||
$t = new lime_test(13, new lime_output_color());
|
||||
|
||||
$t->diag('class DBTable' );
|
||||
$t->is( count($methods) , 11, "class DBTable " . 11 . " methods." );
|
||||
$t->isa_ok( $obj, 'DBTable' , 'class DBTable created');
|
||||
$t->can_ok( $obj, 'SetTo' , 'SetTo()');
|
||||
$t->can_ok( $obj, 'loadEmpty' , 'loadEmpty()');
|
||||
$t->can_ok( $obj, 'loadWhere' , 'loadWhere()');
|
||||
$t->can_ok( $obj, 'load' , 'load()');
|
||||
$t->can_ok( $obj, 'nextvalPGSql', 'nextvalPGSql()');
|
||||
$t->can_ok( $obj, 'insert' , 'insert()');
|
||||
$t->can_ok( $obj, 'update' , 'update()');
|
||||
$t->can_ok( $obj, 'save' , 'save()');
|
||||
$t->can_ok( $obj, 'delete' , 'delete()');
|
||||
$t->can_ok( $obj, 'next' , 'next()');
|
||||
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDatabase_baseTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'database_base');
|
||||
$counter=1;
|
||||
$t = new lime_test( 12, new lime_output_color());
|
||||
$obj = new database_base();
|
||||
$methods = get_class_methods('database_base');
|
||||
|
||||
$t->diag('class database_base' );
|
||||
|
||||
/* Listing Method */
|
||||
|
||||
$t->isa_ok( $obj , 'database_base', 'class database_base created');
|
||||
$t->todo ( 'Listing Method' );
|
||||
$t->is( count ( $methods ) , 8, "class database_base " . count ( $methods ) . " methods." );
|
||||
/* checking methods */
|
||||
|
||||
$t->can_ok( $obj, '__construct' , $counter++.' __construct()');
|
||||
$t->can_ok( $obj, 'generateDropTableSQL' , $counter++.' generateDropTableSQL()');
|
||||
$t->can_ok( $obj, 'generateCreateTableSQL' , $counter++.' generateCreateTableSQL()');
|
||||
$t->can_ok( $obj, 'generateDropColumnSQL' , $counter++.' generateDropColumnSQL()');
|
||||
$t->can_ok( $obj, 'generateAddColumnSQL' , $counter++.' generateAddColumnSQL()');
|
||||
$t->can_ok( $obj, 'generateChangeColumnSQL', $counter++.' generateChangeColumnSQL()');
|
||||
$t->can_ok( $obj, 'executeQuery' , $counter++.' executeQuery()');
|
||||
$t->can_ok( $obj, 'close' , $counter++.' close()');
|
||||
|
||||
$t->todo ( 'Review, specific examples.');
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDatabase_mysqlTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'database_mysql');
|
||||
$t = new lime_test( 24, new lime_output_color());
|
||||
$obj = new database_base();
|
||||
$method = array ();
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('database');
|
||||
$t->diag('class database' );
|
||||
$t->is( count($methods) , 21, "class database " . count($methods) . " methods." );
|
||||
$t->is( $methods[0] , '__construct', '__construct');
|
||||
$t->is( $methods[1] , 'generateCreateTableSQL' , 'generateCreateTableSQL');
|
||||
$t->is( $methods[2] , 'generateDropTableSQL' , 'generateDropTableSQL');
|
||||
$t->is( $methods[3] , 'generateDropColumnSQL' , 'generateDropColumnSQL');
|
||||
$t->is( $methods[4] , 'generateAddColumnSQL' , 'generateAddColumnSQL');
|
||||
$t->is( $methods[5] , 'generateChangeColumnSQL' , 'generateChangeColumnSQL');
|
||||
$t->is( $methods[6] , 'generateGetPrimaryKeysSQL' , 'generateGetPrimaryKeysSQL');
|
||||
$t->is( $methods[7] , 'generateDropPrimaryKeysSQL', 'generateDropPrimaryKeysSQL');
|
||||
$t->is( $methods[8] , 'generateAddPrimaryKeysSQL' , 'generateAddPrimaryKeysSQL');
|
||||
$t->is( $methods[9] , 'generateDropKeySQL' , 'generateDropKeySQL');
|
||||
$t->is( $methods[10] , 'generateAddKeysSQL' , 'generateAddKeysSQL');
|
||||
$t->is( $methods[11] , 'generateShowTablesSQL' , 'generateShowTablesSQL');
|
||||
$t->is( $methods[12] , 'generateShowTablesLikeSQL' , 'generateShowTablesLikeSQL');
|
||||
$t->is( $methods[13] , 'generateDescTableSQL' , 'generateDescTableSQL');
|
||||
$t->is( $methods[14] , 'generateTableIndexSQL' , 'generateTableIndexSQL');
|
||||
$t->is( $methods[15] , 'isConnected' , 'isConnected');
|
||||
$t->is( $methods[16] , 'logQuery' , 'logQuery');
|
||||
$t->is( $methods[17] , 'executeQuery' , 'executeQuery');
|
||||
$t->is( $methods[18] , 'countResults' , 'countResults');
|
||||
$t->is( $methods[19] , 'getRegistry' , 'getRegistry');
|
||||
$t->is( $methods[20] , 'close' , 'close');
|
||||
$t->isa_ok( $obj , 'database_base', 'class database_base created');
|
||||
$t->todo( 'Examples');
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'dynaformhandler');
|
||||
|
||||
$t = new lime_test( 20, new lime_output_color());
|
||||
$obj = "dynaFormHandler";
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('dynaFormHandler');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
|
||||
$t->diag('class dynaFormHandler' );
|
||||
$t->is( $testItems , 18, "class database " . $testItems . " methods." );
|
||||
$t->is( $methods[0] , '__construct' , '__construct');
|
||||
$t->is( $methods[1] , '__cloneEmpty' , '__cloneEmpty');
|
||||
$t->is( $methods[2] , 'toString' , 'toString');
|
||||
$t->is( $methods[3] , 'getNode' , 'getNode');
|
||||
$t->is( $methods[4] , 'setNode' , 'setNode');
|
||||
$t->is( $methods[5] , 'add' , 'add');
|
||||
$t->is( $methods[6] , 'replace' , 'replace');
|
||||
$t->is( $methods[7] , 'save' , 'save');
|
||||
$t->is( $methods[8] , 'fixXmlFile' , 'fixXmlFile');
|
||||
$t->is( $methods[9] , 'setHeaderAttribute' , 'setHeaderAttribute');
|
||||
$t->is( $methods[10] , 'modifyHeaderAttribute' , 'modifyHeaderAttribute');
|
||||
$t->is( $methods[11] , 'updateAttribute' , 'updateAttribute');
|
||||
$t->is( $methods[12] , 'remove' , 'remove');
|
||||
$t->is( $methods[13] , 'nodeExists' , 'nodeExists');
|
||||
$t->is( $methods[14] , 'moveUp' , 'moveUp');
|
||||
$t->is( $methods[15] , 'moveDown' , 'moveDown');
|
||||
$t->is( $methods[16] , 'getFields' , 'getFields');
|
||||
$t->is( $methods[17] , 'getFieldNames' , 'getFieldNames');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classErrorTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
require_once( PATH_GULLIVER . 'class.dbconnection.php');
|
||||
require_once( PATH_GULLIVER . 'class.error.php');
|
||||
|
||||
$obj = new G_Error();
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('G_Error');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
|
||||
$t = new lime_test(11, new lime_output_color());
|
||||
|
||||
$t->diag('class error' );
|
||||
//
|
||||
$t->is( $testItems , 13, "class G_Error " . 13 . " methods." );
|
||||
$t->isa_ok( $obj , 'G_Error', 'class G_Error created');
|
||||
$t->is( G_ERROR , -100, 'G_ERROR constant defined');
|
||||
$t->is( G_ERROR_ALREADY_ASSIGNED , -118, 'G_ERROR_ALREADY_ASSIGNED defined');
|
||||
|
||||
$obj = new G_Error( "string" );
|
||||
$t->is( $obj->code, -1, 'default code error');
|
||||
$t->is( $obj->message, "G Error: string", 'default message error');
|
||||
$t->is( $obj->level, E_USER_NOTICE, 'default level error');
|
||||
|
||||
$obj = new G_Error( G_ERROR_SYSTEM_UID );
|
||||
$t->is( $obj->code, -105, 'code error');
|
||||
$t->is( $obj->message, "G Error: ", 'message error');
|
||||
|
||||
$t->can_ok( $obj, "errorMessage", "exists method errorMessage");
|
||||
$msg = $obj->errorMessage ( G_ERROR );
|
||||
//$t->is( $msg->code, -100, 'fail in method errorMessage');
|
||||
$t->todo( 'fail in method errorMessage');
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classFilterFormTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'filterForm');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
$obj = new filterForm ( 'login/login');
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('filterForm');
|
||||
$t = new lime_test(4, new lime_output_color());
|
||||
$t->diag('class filterForm' );
|
||||
$t->is( count($methods) , 12, "class filterForm " . count($methods) . " methods." );
|
||||
$t->isa_ok( $obj , 'filterForm', 'class filterForm created');
|
||||
$t->can_ok( $obj, 'render', 'render()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classFormTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
$counter=1;
|
||||
$obj = new Form ( 'login/login');
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('Form');
|
||||
$t = new lime_test(15, new lime_output_color());
|
||||
$t->diag('class Form' );
|
||||
$t->is( count($methods) , 12, "class Form " . count($methods) . " methods." );
|
||||
$t->can_ok( $obj, 'Form',$counter++.' Form()');
|
||||
$t->can_ok( $obj, 'setDefaultValues',$counter++.' setDefaultValues()');
|
||||
$t->can_ok( $obj, 'printTemplate', $counter++.' printTemplate()');
|
||||
$t->can_ok( $obj, 'render', $counter++.' render()');
|
||||
$t->can_ok( $obj, 'setValues', $counter++.' setValues()');
|
||||
$t->can_ok( $obj, 'getFields', $counter++.' getFields()');
|
||||
$t->can_ok( $obj, 'validatePost', $counter++.' validatePost()');
|
||||
$t->can_ok( $obj, 'validateArray', $counter++.' validateArray()');
|
||||
$t->can_ok( $obj, 'getVars', $counter++.' getVars()');
|
||||
$t->can_ok( $obj, 'validateRequiredFields', $counter++.' validateRequiredFields()');
|
||||
$t->can_ok( $obj, 'parseFile', $counter++.' parseFile()');
|
||||
$t->can_ok( $obj, 'cloneObject', $counter++.' cloneObject()');
|
||||
$t->is( count($methods) , --$counter , "ok");
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,276 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classGTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
require_once( PATH_GULLIVER .'class.g.php');
|
||||
$obj = new G();
|
||||
$methods = get_class_methods('G');
|
||||
$t = new lime_test( 223, new lime_output_color());
|
||||
$t->diag('class G' );
|
||||
$t->is( count($methods) , 95, "class G " . 95 . " methods." );
|
||||
$t->isa_ok( $obj , 'G', 'class G created');
|
||||
$t->todo( 'review which PHP version is the minimum for Gulliver');
|
||||
$t->is( G::getVersion() , '3.0-1', 'Gulliver version');
|
||||
$t->todo( 'store the version in a file');
|
||||
$t->is( $obj->getIpAddress() , false, 'getIpAddress()');
|
||||
$t->isnt( $obj->getMacAddress() , '', 'getMacAddress()');
|
||||
$t->can_ok( $obj, 'microtime_float', 'microtime_float()');
|
||||
$t->can_ok( $obj, 'setFatalErrorHandler' , 'setFatalErrorHandler()');
|
||||
$t->can_ok( $obj, 'setErrorHandler', 'setErrorHandler()');
|
||||
$t->is( $obj->fatalErrorHandler( 'Fatal error') , 'Fatal error', 'fatalErrorHandler()');
|
||||
$like = '<table cellpadding=1 cellspacing=0 border=0 bgcolor=#808080 width=250><tr><td ><table cellpadding=2 cellspacing=0 border=0 bgcolor=white width=100%><tr bgcolor=#d04040><td colspan=2 nowrap><font color=#ffffaa><code> ERROR CAUGHT check log file</code></font></td></tr><tr ><td colspan=2 nowrap><font color=black><code>IP address: </code></font></td></tr> </table></td></tr></table>';
|
||||
$t->is( $obj->fatalErrorHandler( 'error</b>:abc<br>') , $like, 'fatalErrorHandler()');
|
||||
$t->can_ok( $obj, 'customErrorHandler', 'customErrorHandler()');
|
||||
|
||||
G::customErrorHandler ( G_DB_ERROR, "message error", "filename", 10, "context" ) ;
|
||||
$t->can_ok( $obj, 'showErrorSource', 'showErrorSource()');
|
||||
$t->can_ok( $obj, 'customErrorLog', 'customErrorLog()');
|
||||
$t->can_ok( $obj, 'verboseError', 'verboseError()');
|
||||
$t->can_ok( $obj, 'encrypt', 'encrypt()');
|
||||
$k = URL_KEY;
|
||||
$t->is( G::encrypt ("/sysOpenSource", $k), 'Ytap33°jmZ7D46bf2Jo', 'encrypt only workspace');
|
||||
$t->is( G::encrypt ("/sysOpenSource/", $k), 'Ytap33°jmZ7D46bf2Jpo', 'encrypt terminal slash');
|
||||
$t->is( G::encrypt ("/sysOpenSource/en", $k), 'Ytap33°jmZ7D46bf2Jpo158', 'encrypt two levels');
|
||||
$t->is( G::encrypt ("/sysOpenSource/en/test/login/login", $k), 'Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4A', 'encrypt normal page');
|
||||
$t->is( G::encrypt ("/sysOpenSource/en/test/login/login/demo", $k), 'Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4GDRmNCf', 'encrypt additional level');
|
||||
$t->is( G::encrypt ("/sysOpenSource/en/test/login/login?a=1&b=2", $k), 'Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4HDOcJRWzm2l', 'encrypt normal query string');
|
||||
$t->todo( 'encrypt query string plus pipe');
|
||||
$t->todo("encrypt query string plus pipe");
|
||||
$t->can_ok( $obj, 'decrypt', 'decrypt()');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jo', $k), "/sysOpenSource", 'decrypt only workspace');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jpo', $k), "/sysOpenSource/", 'decrypt terminal slash');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jpo158', $k), "/sysOpenSource/en", 'decrypt two levels');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4A', $k), "/sysOpenSource/en/test/login/login", 'decrypt normal page');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4GDRmNCf', $k), "/sysOpenSource/en/test/login/login/demo", 'decrypt additional level');
|
||||
$t->is( G::decrypt ('Ytap33°jmZ7D46bf2Jpo15+cp8ij4F°fo5fZ4mDZ5Jyi4HDOcJRWzm2l', $k) , "/sysOpenSource/en/test/login/login?a=1&b=2",'decrypt normal query string');
|
||||
$t->todo( 'decrypt query string plus pipe');
|
||||
$t->can_ok( $obj, 'lookup', 'lookup()');
|
||||
$t->is( G::lookup ('optimusprime.colosa.net'), "192.168.1.22", 'lookup any address');
|
||||
$t->can_ok( $obj, 'mk_dir', 'mk_dir()');
|
||||
$newDir = '/tmp/test/directory';
|
||||
$r = G::verifyPath ( $newDir );
|
||||
|
||||
if ( $r ) rmdir ( $newDir );
|
||||
$r = G::mk_dir ( $newDir );
|
||||
$r = G::verifyPath ( $newDir);
|
||||
$t->is( $r, true, "mk_dir() $newDir");
|
||||
$t->can_ok( $obj, 'verifyPath', "verifyPath() $newDir");
|
||||
$t->isnt( PATH_CORE, 'PATH_CORE', 'Constant PATH_CORE');
|
||||
$t->isnt( PATH_GULLIVER, 'PATH_GULLIVER', 'Constant PATH_GULLIVER');
|
||||
$phatSitio = "/home/arturo/processmaker/trunk/workflow/engine/class.x.php/";
|
||||
$phatBuscar = "/processmaker/trunk/workflow/engine/class.x.php/";
|
||||
// The ereg function has been DEPRECATED as of PHP 5.3.0.
|
||||
// $t->is(( ereg( $phatBuscar , $phatSitio ) ), 1 , 'expandPath()');
|
||||
$t->is(( preg_match( '/' . $phatBuscar . '/', $phatSitio ) ), 1 , 'expandPath()');
|
||||
$t->is( G::LoadSystem("error"), NULL, 'LoadSystem()');
|
||||
$t->can_ok( $obj, 'RenderPage', 'RenderPage()');
|
||||
$t->can_ok( $obj, 'LoadSkin', 'LoadSkin()');
|
||||
$t->can_ok( $obj, 'LoadInclude', 'LoadInclude()');
|
||||
$t->can_ok( $obj, 'LoadTemplate', 'LoadTemplate()');
|
||||
$t->can_ok( $obj, 'LoadClassRBAC', 'LoadClassRBAC()');
|
||||
$t->can_ok( $obj, 'LoadClass', 'LoadClass()');
|
||||
$t->can_ok( $obj, 'LoadThirdParty', 'LoadThirdParty()');
|
||||
$t->can_ok( $obj, 'encryptlink', 'encryptlink()');
|
||||
$t->is( G::encryptlink("normal url"), "normal url", 'encryptlink() normal url');
|
||||
$t->todo( 'more tests with encryplink and remove ENABLE_ENCRYPT dependency');
|
||||
$t->can_ok( $obj, 'parseURI', 'parseURI()');
|
||||
|
||||
G::parseURI("http:/192.168.0.9/sysos/en/wf5/login/login/abc?ab=123&bc=zy");
|
||||
$t->todo( 'more tests with parseURI');
|
||||
$t->can_ok( $obj, 'streamFile', 'streamFile()');
|
||||
$t->can_ok( $obj, 'sendHeaders', 'sendHeaders()');
|
||||
$t->todo( 'more tests with sendHeaders');
|
||||
$t->can_ok( $obj, 'virtualURI', 'virtualURI()');
|
||||
$t->can_ok( $obj, 'createUID', 'createUID()');
|
||||
$t->is( G::createUID('directory','filename'), 'bDh5aTBaUG5vNkxwMnByWjJxT2EzNVk___', 'createUID() normal');
|
||||
$t->can_ok( $obj, 'getUIDName', 'getUIDName()');
|
||||
$t->is( G::getUIDName('bDh5aTBaUG5vNkxwMnByWjJxT2EzNVk___','12345678901234567890'), false, 'getUIDName() normal?');
|
||||
$t->can_ok( $obj, 'formatNumber', 'formatNumber()');
|
||||
$t->is( G::formatNumber('100000'), '100000', 'formatNumber() normal');
|
||||
$t->todo( 'is useful the function formatNumber??');
|
||||
$t->can_ok( $obj, 'formatDate', 'formatDate()');
|
||||
$t->is( G::formatDate( '2001-02-29' ), '2001-02-29', 'formatDate() ');
|
||||
$t->is( G::formatDate( '2001-02-29', 'F d, Y' ), 'Februar01 29, 2001', 'formatDate() '); //is not working
|
||||
$t->is( G::formatDate( '2001-02-29', 'd.m.Y' ), '29.02.2001', 'formatDate() ');
|
||||
$t->todo( " the month literal text is defined here!! ");
|
||||
$t->todo( 'review all methods in class G');
|
||||
$i=1;
|
||||
$t->diag('class G' );
|
||||
$t->is( count($methods) , 95, "class database " . count($methods) . " methods." );
|
||||
$t->is( $methods[0] , 'is_https' ,$i++.' is_https');
|
||||
$t->is( $methods[1] , 'array_fill_value' ,$i++.' array_fill_value');
|
||||
$t->is( $methods[2] , 'generate_password' ,$i++.' generate_password');
|
||||
$t->is( $methods[3] , 'array_concat' ,$i++.' array_concat');
|
||||
$t->is( $methods[4] , 'var_compare' ,$i++.' var_compare');
|
||||
$t->is( $methods[5] , 'var_probe' ,$i++.' var_probe');
|
||||
$t->is( $methods[6] , 'getVersion' ,$i++.' getVersion');
|
||||
$t->is( G::getVersion() , '3.0-1', 'Gulliver version 3.0-1');
|
||||
$t->is( $methods[7] , 'getIpAddress' ,$i++.' getIpAddress');
|
||||
$t->is( $obj->getIpAddress() , false, 'getIpAddress()');
|
||||
$t->is( $methods[8] , 'getMacAddress' ,$i++.' getMacAddress');
|
||||
$t->isnt( $obj->getMacAddress() , '', 'getMacAddress()');
|
||||
$t->is( $methods[9] , 'microtime_float' ,$i++.' microtime_float');
|
||||
$t->can_ok( $obj, 'microtime_float', 'microtime_float()');
|
||||
$t->is( $methods[10] , 'setFatalErrorHandler',$i++.' setFatalErrorHandler');
|
||||
$t->can_ok( $obj, 'setFatalErrorHandler' , 'setFatalErrorHandler()');
|
||||
$t->is( $methods[11] , 'setErrorHandler' ,$i++.' setErrorHandler');
|
||||
$t->can_ok( $obj, 'setErrorHandler', 'setErrorHandler()');
|
||||
$t->is( $methods[12] , 'fatalErrorHandler' ,$i++.' fatalErrorHandler');
|
||||
$t->is( $methods[13] , 'customErrorHandler' ,$i++.' customErrorHandler');
|
||||
$t->is( $methods[14] , 'showErrorSource' ,$i++.' showErrorSource');
|
||||
$t->is( $methods[15] , 'customErrorLog' ,$i++.' customErrorLog');
|
||||
$t->is( $methods[16] , 'verboseError' ,$i++.' verboseError');
|
||||
$t->is( $methods[17] , 'encrypt' ,$i++.' encrypt');
|
||||
$t->is( $methods[18] , 'decrypt' ,$i++.' decrypt');
|
||||
$t->is( $methods[19] , 'lookup' ,$i++.' lookup');
|
||||
$t->is( $methods[20] , 'mk_dir' ,$i++.' mk_dir');
|
||||
$t->is( $methods[21] , 'rm_dir' ,$i++.' rm_dir');
|
||||
$t->is( $methods[22] , 'verifyPath' ,$i++.' verifyPath');
|
||||
$t->is( $methods[23] , 'expandPath' ,$i++.' expandPath');
|
||||
$t->is( $methods[24] , 'LoadSystem' ,$i++.' LoadSystem');
|
||||
$t->is( $methods[25] , 'RenderPage' ,$i++.' RenderPage');
|
||||
$t->is( $methods[26] , 'LoadSkin' ,$i++.' LoadSkin');
|
||||
$t->is( $methods[27] , 'LoadInclude' ,$i++. ' LoadInclude');
|
||||
$t->is( $methods[28] , 'LoadAllModelClasses',$i++. ' LoadAllModelClasses');
|
||||
$t->is( $methods[29] , 'LoadAllPluginModelClasses',$i++. ' LoadAllPluginModelClasses');
|
||||
$t->is( $methods[30] , 'LoadTemplate' ,$i++. ' LoadTemplate');
|
||||
$t->is( $methods[31] , 'LoadClassRBAC' ,$i++. ' LoadClassRBAC');
|
||||
$t->is( $methods[32] , 'LoadClass' ,$i++. ' LoadClass');
|
||||
$t->is( $methods[33] , 'LoadThirdParty' ,$i++. ' LoadThirdParty');
|
||||
$t->is( $methods[34] , 'encryptlink' ,$i++. ' encryptlink');
|
||||
$t->is( $methods[35] , 'parseURI' ,$i++. ' parseURI');
|
||||
$t->is( $methods[36] , 'streamFile' ,$i++. ' streamFile');
|
||||
$t->is( $methods[37] , 'trimSourceCodeFile' ,$i++. ' trimSourceCodeFile');
|
||||
$t->is( $methods[38] , 'sendHeaders' ,$i++. ' sendHeaders');
|
||||
$t->is( $methods[39] , 'virtualURI' ,$i++. ' virtualURI');
|
||||
$t->is( $methods[40] , 'createUID' ,$i++. ' createUID');
|
||||
$t->is( $methods[41] , 'getUIDName' ,$i++. ' getUIDName');
|
||||
$t->is( $methods[42] , 'formatNumber' ,$i++. ' formatNumber');
|
||||
$t->is( $methods[43] , 'formatDate' ,$i++. ' formatDate');
|
||||
$t->is( $methods[44] , 'getformatedDate' ,$i++. ' getformatedDate');
|
||||
$t->is( $methods[45] , 'arrayDiff' ,$i++. ' arrayDiff');
|
||||
$t->is( $methods[46] , 'complete_field' ,$i++. ' complete_field');
|
||||
$t->is( $methods[47] , 'sqlEscape' ,$i++. ' sqlEscape');
|
||||
$t->is( $methods[48] , 'replaceDataField' ,$i++. ' replaceDataField');
|
||||
$t->can_ok( $obj, 'replaceDataField', 'replaceDataField()');
|
||||
$t->todo( 'improve the function replaceDataField !!');
|
||||
$t->is( $methods[49] , 'loadLanguageFile' ,$i++. ' loadLanguageFile');
|
||||
$t->can_ok( $obj, 'loadLanguageFile', 'loadLanguageFile()');
|
||||
$t->todo( 'more tests with the function loadLanguageFile !!');
|
||||
$t->is( $methods[50] , 'registerLabel' ,$i++. ' registerLabel');
|
||||
$t->can_ok( $obj, 'registerLabel', 'registerLabel()');
|
||||
$t->todo( 'more tests with the function registerLabel !!');
|
||||
$t->is( $methods[51] , 'LoadMenuXml' ,$i++. ' LoadMenuXml');
|
||||
$t->can_ok( $obj, 'LoadMenuXml', 'LoadMenuXml()');
|
||||
$t->todo( 'more tests with the function LoadMenuXml !!');
|
||||
$t->is( $methods[52] , 'SendMessageXml' ,$i++. ' SendMessageXml');
|
||||
$t->can_ok( $obj, 'SendMessageXml', 'SendMessageXml()');
|
||||
$t->todo( 'more tests with the function SendMessageXml !!');
|
||||
$t->is( $methods[53] , 'SendTemporalMessage',$i++. ' SendTemporalMessage');
|
||||
$t->is( $methods[54] , 'SendMessage' ,$i++. ' SendMessage');
|
||||
$t->can_ok( $obj, 'SendTemporalMessage', 'SendTemporalMessage()');
|
||||
$t->todo( 'more tests with the function SendTemporalMessage !!');
|
||||
$t->can_ok( $obj, 'SendMessage', 'SendMessage()');
|
||||
$t->todo( 'more tests with the function SendMessage !!');
|
||||
$t->is( $methods[55] , 'SendMessageText' ,$i++. ' SendMessageText');
|
||||
$t->is( $methods[56] , 'LoadMessage' ,$i++. ' LoadMessage');
|
||||
$t->can_ok( $obj, 'LoadMessage', 'LoadMessage()');
|
||||
$t->todo( 'more tests with the function LoadMessage !!');
|
||||
$t->is( $methods[57] , 'LoadXmlLabel' ,$i++. ' LoadXmlLabel');
|
||||
$t->can_ok( $obj, 'LoadXmlLabel', 'LoadXmlLabel()');
|
||||
$t->todo( 'is useful the function LoadXmlLabel ??? delete it!!');
|
||||
$t->is( $methods[58] , 'LoadMessageXml' ,$i++. ' LoadMessageXml');
|
||||
$t->can_ok( $obj, 'LoadMessageXml', 'LoadMessageXml()');
|
||||
$t->todo( 'more tests with the function LoadMessageXml !!');
|
||||
$t->is( $methods[59] , 'LoadTranslationObject',$i++. ' LoadTranslationObject');
|
||||
$t->can_ok( $obj, 'LoadTranslation', 'LoadTranslation()');
|
||||
$t->todo( 'more tests with the function LoadTranslation !!');
|
||||
$t->is( $methods[60] , 'LoadTranslation' ,$i++. ' LoadTranslation');
|
||||
$t->is( $methods[61] , 'LoadArrayFile' ,$i++. ' LoadArrayFile');
|
||||
$t->can_ok( $obj, 'LoadArrayFile', 'LoadArrayFile()');
|
||||
$t->todo( 'more tests with the function LoadArrayFile !!');
|
||||
$t->is( $methods[62] , 'expandUri' ,$i++. ' expandUri');
|
||||
$t->can_ok( $obj, 'expandUri', 'expandUri()');
|
||||
$t->todo( 'more tests with the function expandUri !!');
|
||||
$t->is( $methods[63] , 'genericForceLogin' ,$i++. ' genericForceLogin');
|
||||
$t->can_ok( $obj, 'genericForceLogin', 'genericForceLogin()');
|
||||
$t->todo( 'more tests with the function genericForceLogin !!');
|
||||
$t->is( $methods[64] , 'capitalize' ,$i++. ' capitalize');
|
||||
$t->is( $methods[65] , 'toUpper' ,$i++. ' toUpper');
|
||||
$t->is( $methods[66] , 'toLower' ,$i++. ' toLower');
|
||||
$t->is( $methods[67] , 'http_build_query' ,$i++. ' http_build_query');
|
||||
$t->is( $methods[68] , 'header' ,$i++. ' header');
|
||||
$t->can_ok( $obj, 'http_build_query', 'http_build_query()');
|
||||
$t->todo( 'more tests with the function http_build_query !!');
|
||||
$t->can_ok( $obj, 'header', 'header()');
|
||||
$t->todo( 'more tests with the function header !!');
|
||||
$t->is( $methods[69] , 'forceLogin' ,$i++. ' forceLogin');
|
||||
$t->can_ok( $obj, 'forceLogin', 'forceLogin()');
|
||||
$t->todo( 'more tests with the function forceLogin , DELETE IT!!');
|
||||
$t->is( $methods[70] , 'add_slashes' ,$i++. ' add_slashes');
|
||||
$t->can_ok( $obj, 'add_slashes', 'add_slashes()');
|
||||
$t->todo( 'more tests with the function add_slashes !!');
|
||||
$t->is( $methods[71] , 'uploadFile' ,$i++. ' uploadFile');
|
||||
$t->can_ok( $obj, 'uploadFile', 'uploadFile()');
|
||||
$t->todo( 'more tests with the function uploadFile !!');
|
||||
$t->is( $methods[72] , 'resizeImage' ,$i++. ' resizeImage');
|
||||
$t->is( $methods[73] , 'array_merges' ,$i++. ' array_merges');
|
||||
$t->can_ok( $obj, 'array_merges', 'array_merges()');
|
||||
$t->todo( 'more tests with the function array_merges !!');
|
||||
$t->is( $methods[74] , 'array_merge_2' ,$i++. ' array_merge_2');
|
||||
$t->can_ok( $obj, 'array_merge_2', 'array_merge_2()');
|
||||
$t->todo( 'more tests with the function array_merge_2 !!');
|
||||
$t->is( $methods[75] , 'generateUniqueID' ,$i++. ' generateUniqueID');
|
||||
$t->can_ok( $obj, 'generateUniqueID', 'generateUniqueID()');
|
||||
$t->todo( 'more tests with the function sqlEscape !! is useful? delete it !!');
|
||||
$t->can_ok( $obj, 'generateUniqueID', 'generateUniqueID()');
|
||||
$t->todo( 'more tests with the function sqlEscape !! is useful? delete it !!');
|
||||
$t->is( $methods[76] , 'generateCode' ,$i++. ' generateCode');
|
||||
$t->is( $methods[77] , 'verifyUniqueID' ,$i++. ' verifyUniqueID');
|
||||
$t->is( $methods[78] , 'is_utf8' ,$i++. ' is_utf8');
|
||||
$t->is( $methods[79] , 'CurDate' ,$i++. ' CurDate');
|
||||
$t->can_ok( $obj, 'CurDate', 'CurDate()');
|
||||
$t->todo( 'more tests with the function sqlEscape !!');
|
||||
$t->is( $methods[80] , 'getSystemConstants',$i++. ' getSystemConstants');
|
||||
$t->is( $methods[81] , 'capitalizeWords' ,$i++. ' capitalizeWords');
|
||||
$t->is( $methods[82] , 'unhtmlentities' ,$i++. ' unhtmlentities');
|
||||
$t->is( $methods[83] , 'xmlParser' ,$i++. ' xmlParser');
|
||||
$t->is( $methods[84] , '_del_p' ,$i++. ' _del_p');
|
||||
$t->is( $methods[85] , 'ary2xml' ,$i++. ' ary2xml');
|
||||
$t->is( $methods[86] , 'ins2ary' ,$i++. ' ins2ary');
|
||||
$t->is( $methods[87] , 'evalJScript' ,$i++. ' evalJScript');
|
||||
$t->is( $methods[88] , 'inflect' ,$i++. ' inflect');
|
||||
$t->is( $methods[89] , 'pr' ,$i++. ' pr');
|
||||
$t->is( $methods[90] , 'dump' ,$i++. ' dump');
|
||||
$t->is( $methods[91] , 'stripCDATA' ,$i++. ' stripCDATA');
|
||||
$t->is( $methods[92] , 'sys_get_temp_dir' ,$i++. ' sys_get_temp_dir');
|
||||
$t->is( $methods[93] , 'PMWSCompositeResponse' ,$i++. ' PMWSCompositeResponse');
|
||||
$t->is( $methods[94] , 'emailAddress' ,$i++. ' emailAddress');
|
||||
$t->is( count( $methods ) , --$i , count( $methods ).' = '.$i.' ok');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classHeadPublisherTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'headPublisher');
|
||||
$counter=1;
|
||||
$t = new lime_test( 13 , new lime_output_color());
|
||||
|
||||
$obj =& headPublisher::getSingleton();
|
||||
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$methods = get_class_methods('headPublisher');
|
||||
|
||||
$t->diag('class headPublisher' );
|
||||
$t->is( 10 ,count($methods) , "class headPublisher " . count($methods) . " methods." );
|
||||
$t->isa_ok( $obj, 'headPublisher', $counter++.' class headPublisher created');
|
||||
$t->can_ok( $obj, 'getSingleton', $counter++.' getSingleton()');
|
||||
$t->can_ok( $obj, 'setTitle', $counter++.' setTitle()');
|
||||
$t->can_ok( $obj, 'addScriptFile', $counter++.' addScriptFile()');
|
||||
$t->can_ok( $obj, 'addInstanceModule',$counter++.' addInstanceModule()');
|
||||
$t->can_ok( $obj, 'addClassModule', $counter++.' addClassModule()');
|
||||
$t->can_ok( $obj, 'addScriptCode', $counter++.' addScriptCode()');
|
||||
$t->can_ok( $obj, 'printHeader', $counter++.' printHeader()');
|
||||
$t->can_ok( $obj, 'printRawHeader', $counter++.' printRawHeader()');
|
||||
$t->can_ok( $obj, 'clearScripts', $counter++.' clearScripts()');
|
||||
$t->is( count($methods) ,--$counter , " methods ". $counter." OK" );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classMailerTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'mailer');
|
||||
$obj = new mailer ();
|
||||
$testItems = 0;
|
||||
$method = get_class_methods('mailer');
|
||||
$t = new lime_test(11, new lime_output_color());
|
||||
$t->diag('class mailer' );
|
||||
$t->is( count($method) , 7, "class mailer " . count($method) . " methods." );
|
||||
$t->isa_ok( $obj , 'mailer', 'class mailer created');
|
||||
$t->can_ok( $obj, 'instanceMailer', 'instanceMailer()');
|
||||
$t->can_ok( $obj, 'arpaEMAIL', 'arpaEMAIL()');
|
||||
$t->can_ok( $obj, 'sendTemplate', 'sendTemplate()');
|
||||
$t->can_ok( $obj, 'sendHtml', 'sendHtml()');
|
||||
$t->can_ok( $obj, 'sendText', 'sendText()');
|
||||
$t->can_ok( $obj, 'replaceFields', 'replaceFields()');
|
||||
$t->can_ok( $obj, 'html2text', 'html2text()');
|
||||
$t->todo( 'delete function html2text !!!');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classMenuTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'menu');
|
||||
|
||||
$obj = new Menu ();
|
||||
$counter=1;
|
||||
$method = get_class_methods('Menu');print_r($class_methods);
|
||||
$t = new lime_test(15, new lime_output_color());
|
||||
$t->diag('class Menu' );
|
||||
$t->is( count($method) , 11, "class Menu " . count($method) . " methods." );
|
||||
$t->isa_ok( $obj , 'Menu', 'class Menu created');
|
||||
$t->can_ok( $obj, 'SetClass' , $counter++.' SetClass()');
|
||||
$t->can_ok( $obj, 'Load' , $counter++.' Load()');
|
||||
$t->can_ok( $obj, 'OptionCount' , $counter++.' OptionCount()');
|
||||
$t->can_ok( $obj, 'AddOption' , $counter++.' AddOption()');
|
||||
$t->can_ok( $obj, 'AddIdOption' , $counter++.' AddIdOption()');
|
||||
$t->can_ok( $obj, 'AddRawOption' , $counter++.' AddRawOption()');
|
||||
$t->can_ok( $obj, 'AddIdRawOption' , $counter++.' AddIdRawOption()');
|
||||
$t->can_ok( $obj, 'DisableOptionPos', $counter++.' DisableOptionPos()');
|
||||
$t->can_ok( $obj, 'DisableOptionId' , $counter++.' DisableOptionId()');
|
||||
$t->can_ok( $obj, 'RenderOption' , $counter++.' RenderOption()');
|
||||
$t->can_ok( $obj, 'generateArrayForTemplate', $counter++.' generateArrayForTemplate()');
|
||||
$t->is( count($method) , --$counter , " methods " );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classObjectTemplateTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'objectTemplate');
|
||||
|
||||
$obj = new objectTemplate ( '');
|
||||
$method = get_class_methods('objectTemplate');
|
||||
$t = new lime_test( 4, new lime_output_color());
|
||||
$t->diag('class objectTemplate' );
|
||||
$t->is( count($method ) , 60, "class objectTemplate " . count($method ) . " methods." );
|
||||
$t->isa_ok( $obj , 'objectTemplate', 'class objectTemplate created');
|
||||
$t->can_ok( $obj, 'printObject', 'printObject()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classPagedTableTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'pagedTable');
|
||||
|
||||
$t = new lime_test( 2, new lime_output_color());
|
||||
$obj = "pagedTable";
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$method = get_class_methods('pagedTable');
|
||||
$t->diag('class pagedTable' );
|
||||
$t->is( count($method) , 10, "class pagedTable " . $testItems . " methods." );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classPublisherTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'publisher');
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$method = get_class_methods('publisher');
|
||||
$t = new lime_test( 6, new lime_output_color());
|
||||
$obj = new Publisher ( 'field' );
|
||||
$t->diag('class Publisher' );
|
||||
$t->is( count($method) , 3, "class publisher " . count($method) . " methods." );
|
||||
$t->isa_ok( $obj , 'Publisher' , 'class Publisher created');
|
||||
$t->can_ok( $obj , 'AddContent' , 'AddContent()');
|
||||
$t->can_ok( $obj , 'RenderContent' , 'RenderContent()');
|
||||
$t->can_ok( $obj , 'RenderContent0', 'RenderContent0()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classRbacTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'rbac');
|
||||
|
||||
$method = array ( );
|
||||
$method = get_class_methods('RBAC');
|
||||
$t = new lime_test( 8, new lime_output_color());
|
||||
$obj =& RBAC::getSingleton();
|
||||
$t->diag('class RBAC' );
|
||||
$t->is( count($method), 46, "class RBAC " . count($method) . " methods." );
|
||||
$t->isa_ok( $obj, 'RBAC', 'class RBAC created');
|
||||
$t->can_ok( $obj, 'VerifyLogin', 'VerifyLogin()');
|
||||
$t->can_ok( $obj, 'userCanAccess', 'userCanAccess()');
|
||||
$t->can_ok( $obj, 'load', 'load()');
|
||||
$t->can_ok( $obj, 'createUser', 'createUser()');
|
||||
$t->can_ok( $obj, 'listAllRoles', 'listAllRoles()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classTableTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'table');
|
||||
|
||||
$t = new lime_test(24, new lime_output_color());
|
||||
$obj = new Table();
|
||||
$method = get_class_methods('Table');
|
||||
$t->diag('class Table' );
|
||||
$t->is( count($method) , 23, "class Table " . count($method). " methods." );
|
||||
$t->isa_ok( $obj, 'Table', 'class Table created');
|
||||
$t->can_ok( $obj, 'SetTo', 'SetTo()');
|
||||
$t->can_ok( $obj, 'SetSource', 'SetSource()');
|
||||
$t->can_ok( $obj, 'GetSource', 'GetSource()');
|
||||
$t->can_ok( $obj, 'TotalCount', 'TotalCount()');
|
||||
$t->can_ok( $obj, 'Count', 'Count()');
|
||||
$t->can_ok( $obj, 'CurRow', 'CurRow()');
|
||||
$t->can_ok( $obj, 'ColumnCount', 'ColumnCount()');
|
||||
$t->can_ok( $obj, 'Read', 'Read()');
|
||||
$t->can_ok( $obj, 'Seek', 'Seek()');
|
||||
$t->can_ok( $obj, 'MoveFirst', 'MoveFirst()');
|
||||
$t->can_ok( $obj, 'EOF', 'EOF()');
|
||||
$t->can_ok( $obj, 'AddColumn', 'AddColumn()');
|
||||
$t->can_ok( $obj, 'AddRawColumn', 'AddRawColumn()');
|
||||
$t->can_ok( $obj, 'RenderTitle_ajax', 'RenderTitle_ajax()');
|
||||
$t->can_ok( $obj, 'RenderTitle2', 'RenderTitle2()');
|
||||
$t->can_ok( $obj, 'RenderColumn', 'RenderColumn()');
|
||||
$t->can_ok( $obj, 'SetAction', 'SetAction()');
|
||||
$t->can_ok( $obj, 'setTranslate', 'setTranslate()');
|
||||
$t->can_ok( $obj, 'translateValue', 'translateValue()');
|
||||
$t->can_ok( $obj, 'setContext', 'setContext()');
|
||||
$t->can_ok( $obj, 'ParsingFromHtml', 'ParsingFromHtml()');
|
||||
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classTemplatePowerTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'templatePower');
|
||||
$t = new lime_test(16, new lime_output_color());
|
||||
$obj = new TemplatePowerParser( 'a', 'b' );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('TemplatePowerParser');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class TemplatePowerParser' );
|
||||
$t->is( $testItems , 8, "class TemplatePowerParser " . $testItems . " methods." );
|
||||
$t->isa_ok( $obj , 'TemplatePowerParser', 'class TemplatePowerParser created');
|
||||
$t->can_ok( $obj, '__prepare', '__prepare()');
|
||||
$t->can_ok( $obj, '__prepareTemplate', '__prepareTemplate()');
|
||||
$t->can_ok( $obj, '__parseTemplate', '__parseTemplate()');
|
||||
$obj = new TemplatePower( );
|
||||
$t->can_ok( $obj, '__outputContent', '__outputContent()');
|
||||
$t->can_ok( $obj, '__printVars', '__printVars()');
|
||||
$t->can_ok( $obj, 'prepare', 'prepare()');
|
||||
$t->can_ok( $obj, 'newBlock', 'newBlock()');
|
||||
$t->can_ok( $obj, 'assignGlobal', 'assignGlobal()');
|
||||
$t->can_ok( $obj, 'assign', 'assign()');
|
||||
$t->can_ok( $obj, 'gotoBlock', 'gotoBlock()');
|
||||
$t->can_ok( $obj, 'getVarValue', 'getVarValue()');
|
||||
$t->can_ok( $obj, 'printToScreen', 'printToScreen()');
|
||||
$t->can_ok( $obj, 'getOutputContent', 'getOutputContent()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classTreeTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'tree');
|
||||
$t = new lime_test(7, new lime_output_color());
|
||||
$obj = new Tree( array ('name' => 'value' ) );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('Tree');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class Tree' );
|
||||
$t->is( $testItems , 14, "class Tree " . $testItems . " methods." );
|
||||
$t->isa_ok( $obj , 'Tree', 'class Tree created');
|
||||
$t->can_ok( $obj, 'addChild', 'addChild()');
|
||||
$t->can_ok( $obj, 'printPlus', 'printPlus()');
|
||||
$t->can_ok( $obj, 'printContent', 'printContent()');
|
||||
$t->can_ok( $obj, 'render', 'render()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classWebResourceTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'webResource');
|
||||
|
||||
$t = new lime_test( 2, new lime_output_color());
|
||||
$obj = "WebResource";
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('WebResource');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class WebResource' );
|
||||
$t->is( $testItems , 2, "class WebResource " . $testItems . " methods." );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classXmlDocumentTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
$t = new lime_test(11, new lime_output_color());
|
||||
$obj = new Xml_Node( 'name', 'type', 'value' );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('Xml_Node');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class Xml_Node' );
|
||||
$t->is( $testItems , 8, "class Xml_Node " . $testItems . " methods." );
|
||||
|
||||
$t->isa_ok( $obj , 'Xml_Node' , 'class Xml_Node created');
|
||||
$t->can_ok( $obj , 'addAttribute', 'addAttribute()');
|
||||
$t->can_ok( $obj , 'addChildNode', 'addChildNode()');
|
||||
$t->can_ok( $obj , 'toTree' , 'toTree()');
|
||||
$t->can_ok( $obj , 'findNode' , 'findNode()');
|
||||
$t->can_ok( $obj , 'getXML' , 'getXML()');
|
||||
$obj = new Xml_document( 'name', 'type', 'value' );
|
||||
$t->diag('class Xml_document' );
|
||||
$t->isa_ok( $obj , 'Xml_document', 'class Xml_document created');
|
||||
$t->can_ok( $obj , 'parseXmlFile', 'parseXmlFile()');
|
||||
$t->can_ok( $obj , 'getXML' , 'getXML()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classXmlMenuTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
require_once( PATH_CORE . 'config' . PATH_SEP . 'environments.php');
|
||||
|
||||
global $G_ENVIRONMENTS;
|
||||
if ( isset ( $G_ENVIRONMENTS ) ) {
|
||||
$dbfile = $G_ENVIRONMENTS[ G_TEST_ENV ][ 'dbfile'];
|
||||
if ( !file_exists ( $dbfile ) ) {
|
||||
printf("%s \n", pakeColor::colorize( "dbfile $dbfile doesn't exist for environment " . G_ENVIRONMENT , 'ERROR'));
|
||||
exit (200);
|
||||
}
|
||||
else
|
||||
include ( $dbfile );
|
||||
}
|
||||
else
|
||||
exit (201);
|
||||
G::LoadThirdParty('pear/json','class.json');
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'xmlMenu');
|
||||
$t = new lime_test(4, new lime_output_color());
|
||||
$obj = new xmlMenu( 'login/login' );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('xmlMenu');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class xmlMenu' );
|
||||
$t->is( $testItems , 12, "class xmlMenu " . $testItems . " methods." );
|
||||
$t->isa_ok( $obj , 'xmlMenu', 'class xmlMenu created');
|
||||
$t->can_ok( $obj, 'render', 'render()');
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classXmlformExtensionTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'xmlformExtension');
|
||||
|
||||
$t = new lime_test( 2, new lime_output_color());
|
||||
$obj ="database_base";
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('XmlForm_Field_Label');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class XmlForm_Field_Label' );
|
||||
$t->is( $testItems , 18, "class XmlForm_Field_Label " . $testItems . " methods." );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classXmlformTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
if ( !defined ('PATH_THIRDPARTY') ) {
|
||||
require_once( $_SERVER['PWD']. '/test/bootstrap/unit.php');
|
||||
}
|
||||
require_once( PATH_THIRDPARTY . 'lime/lime.php');
|
||||
define ( 'G_ENVIRONMENT', G_TEST_ENV);
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
$t = new lime_test( 2, new lime_output_color());
|
||||
$obj = "XmlForm_Field";
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
$class_methods = get_class_methods('XmlForm_Field');
|
||||
foreach ($class_methods as $method_name) {
|
||||
$methods[ $testItems ] = $method_name;
|
||||
$testItems++;
|
||||
}
|
||||
$t->diag('class XmlForm_Field' );
|
||||
$t->is( $testItems , 18, "class XmlForm_Field " . $testItems . " methods." );
|
||||
$t->todo( 'review all pendings in this class');
|
||||
@@ -1,167 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classArchiveTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
Propel::init( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'error');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'archive');
|
||||
|
||||
$obj = new Archive ($dbc);
|
||||
$t = new lime_test( 27, new lime_output_color() );
|
||||
|
||||
$className = Archive;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
|
||||
$t->diag( "class $className " );
|
||||
$t->isa_ok( $obj , $className, "class $className created" );
|
||||
|
||||
$t->is( count($methods) , 12, "class $className have " . 12 . ' methods.' );
|
||||
|
||||
//checking method 'archive'
|
||||
$t->can_ok( $obj, 'archive', 'archive() is callable' );
|
||||
|
||||
//$result = $obj->archive ( $name);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method archive ');
|
||||
$t->todo( "call to method archive using $name ");
|
||||
|
||||
|
||||
//checking method 'set_options'
|
||||
$t->can_ok( $obj, 'set_options', 'set_options() is callable' );
|
||||
|
||||
//$result = $obj->set_options ( $options);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method set_options ');
|
||||
$t->todo( "call to method set_options using $options ");
|
||||
|
||||
|
||||
//checking method 'create_archive'
|
||||
$t->can_ok( $obj, 'create_archive', 'create_archive() is callable' );
|
||||
|
||||
//$result = $obj->create_archive ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method create_archive ');
|
||||
$t->todo( "call to method create_archive using ");
|
||||
|
||||
|
||||
//checking method 'add_data'
|
||||
$t->can_ok( $obj, 'add_data', 'add_data() is callable' );
|
||||
|
||||
//$result = $obj->add_data ( $data);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method add_data ');
|
||||
$t->todo( "call to method add_data using $data ");
|
||||
|
||||
|
||||
//checking method 'make_list'
|
||||
$t->can_ok( $obj, 'make_list', 'make_list() is callable' );
|
||||
|
||||
//$result = $obj->make_list ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method make_list ');
|
||||
$t->todo( "call to method make_list using ");
|
||||
|
||||
|
||||
//checking method 'add_files'
|
||||
$t->can_ok( $obj, 'add_files', 'add_files() is callable' );
|
||||
|
||||
//$result = $obj->add_files ( $list);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method add_files ');
|
||||
$t->todo( "call to method add_files using $list ");
|
||||
|
||||
|
||||
//checking method 'exclude_files'
|
||||
$t->can_ok( $obj, 'exclude_files', 'exclude_files() is callable' );
|
||||
|
||||
//$result = $obj->exclude_files ( $list);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method exclude_files ');
|
||||
$t->todo( "call to method exclude_files using $list ");
|
||||
|
||||
|
||||
//checking method 'store_files'
|
||||
$t->can_ok( $obj, 'store_files', 'store_files() is callable' );
|
||||
|
||||
//$result = $obj->store_files ( $list);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method store_files ');
|
||||
$t->todo( "call to method store_files using $list ");
|
||||
|
||||
|
||||
//checking method 'list_files'
|
||||
$t->can_ok( $obj, 'list_files', 'list_files() is callable' );
|
||||
|
||||
//$result = $obj->list_files ( $list);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method list_files ');
|
||||
$t->todo( "call to method list_files using $list ");
|
||||
|
||||
|
||||
//checking method 'parse_dir'
|
||||
$t->can_ok( $obj, 'parse_dir', 'parse_dir() is callable' );
|
||||
|
||||
//$result = $obj->parse_dir ( $dirname);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method parse_dir ');
|
||||
$t->todo( "call to method parse_dir using $dirname ");
|
||||
|
||||
|
||||
//checking method 'sort_files'
|
||||
$t->can_ok( $obj, 'sort_files', 'sort_files() is callable' );
|
||||
|
||||
//$result = $obj->sort_files ( $a, $b);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method sort_files ');
|
||||
$t->todo( "call to method sort_files using $a, $b ");
|
||||
|
||||
|
||||
//checking method 'download_file'
|
||||
$t->can_ok( $obj, 'download_file', 'download_file() is callable' );
|
||||
|
||||
//$result = $obj->download_file ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method download_file ');
|
||||
$t->todo( "call to method download_file using ");
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
|
||||
?>
|
||||
@@ -1,229 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classArrayBasePeerTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'ArrayPeer');
|
||||
|
||||
$t = new lime_test( 44, new lime_output_color() );
|
||||
$className = "ArrayBasePeer";
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
$t->diag("class $className" );
|
||||
//$t->isa_ok( $obj , $className, "class $className created");
|
||||
|
||||
$t->is( count($methods) , 21, "class $className have " . 21 . ' methods.' );
|
||||
$aMethods = array_keys ( $methods );
|
||||
|
||||
//checking method 'getMapBuilder'
|
||||
$t->is ( $aMethods[0], 'getMapBuilder', 'getMapBuilder() is callable' );
|
||||
|
||||
//$result = $obj->getMapBuilder ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getMapBuilder ');
|
||||
$t->todo( "call to method getMapBuilder using ");
|
||||
|
||||
|
||||
//checking method 'getPhpNameMap'
|
||||
$t->is ( $aMethods[1], 'getPhpNameMap', 'getPhpNameMap() is callable' );
|
||||
|
||||
//$result = $obj->getPhpNameMap ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getPhpNameMap ');
|
||||
$t->todo( "call to method getPhpNameMap using ");
|
||||
|
||||
//checking method 'translateFieldName'
|
||||
$t->is ( $aMethods[2], 'translateFieldName', 'translateFieldName() is callable' );
|
||||
|
||||
//$result = $obj->translateFieldName ( $name, $fromType, $toType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method translateFieldName ');
|
||||
$t->todo( "call to method translateFieldName using $name, $fromType, $toType ");
|
||||
|
||||
|
||||
//checking method 'getFieldNames'
|
||||
$t->is ( $aMethods[3], 'getFieldNames', 'getFieldNames() is callable' );
|
||||
|
||||
//$result = $obj->getFieldNames ( $type);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getFieldNames ');
|
||||
$t->todo( "call to method getFieldNames using $type ");
|
||||
|
||||
|
||||
//checking method 'alias'
|
||||
$t->is ( $aMethods[4], 'alias', 'alias() is callable' );
|
||||
|
||||
//$result = $obj->alias ( $alias, $column);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method alias ');
|
||||
$t->todo( "call to method alias using $alias, $column ");
|
||||
|
||||
//checking method 'addSelectColumns'
|
||||
$t->is ( $aMethods[5], 'addSelectColumns', 'addSelectColumns() is callable' );
|
||||
|
||||
//$result = $obj->addSelectColumns ( $criteria);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method addSelectColumns ');
|
||||
$t->todo( "call to method addSelectColumns using $criteria ");
|
||||
|
||||
|
||||
//checking method 'doCount'
|
||||
$t->is ( $aMethods[6], 'doCount', 'doCount() is callable' );
|
||||
|
||||
//$result = $obj->doCount ( $criteria, $distinct, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doCount ');
|
||||
$t->todo( "call to method doCount using $criteria, $distinct, $con ");
|
||||
|
||||
|
||||
//checking method 'doSelectOne'
|
||||
$t->is ( $aMethods[7], 'doSelectOne', 'doSelectOne() is callable' );
|
||||
|
||||
//$result = $obj->doSelectOne ( $criteria, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doSelectOne ');
|
||||
$t->todo( "call to method doSelectOne using $criteria, $con ");
|
||||
|
||||
|
||||
//checking method 'createSelectSql'
|
||||
$t->is ( $aMethods[8], 'createSelectSql', 'createSelectSql() is callable' );
|
||||
|
||||
//$result = $obj->createSelectSql ( $criteria, $tableName, $params);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method createSelectSql ');
|
||||
$t->todo( "call to method createSelectSql using $criteria, $tableName, $params ");
|
||||
|
||||
|
||||
//checking method 'doSelect'
|
||||
$t->is ( $aMethods[9], 'doSelect', 'doSelect() is callable' );
|
||||
|
||||
//$result = $obj->doSelect ( $criteria, $tableName, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doSelect ');
|
||||
$t->todo( "call to method doSelect using $criteria, $tableName, $con ");
|
||||
|
||||
|
||||
//checking method 'doSelectRS'
|
||||
$t->is ( $aMethods[10], 'doSelectRS', 'doSelectRS() is callable' );
|
||||
|
||||
//$result = $obj->doSelectRS ( $criteria, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doSelectRS ');
|
||||
$t->todo( "call to method doSelectRS using $criteria, $con ");
|
||||
|
||||
|
||||
//checking method 'populateObjects'
|
||||
$t->is ( $aMethods[11], 'populateObjects', 'populateObjects() is callable' );
|
||||
|
||||
//$result = $obj->populateObjects ( $rs);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method populateObjects ');
|
||||
$t->todo( "call to method populateObjects using $rs ");
|
||||
|
||||
|
||||
//checking method 'getTableMap'
|
||||
$t->is ( $aMethods[12], 'getTableMap', 'getTableMap() is callable' );
|
||||
|
||||
//$result = $obj->getTableMap ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getTableMap ');
|
||||
$t->todo( "call to method getTableMap using ");
|
||||
|
||||
|
||||
//checking method 'getOMClass'
|
||||
$t->is ( $aMethods[13], 'getOMClass', 'getOMClass() is callable' );
|
||||
|
||||
//$result = $obj->getOMClass ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getOMClass ');
|
||||
$t->todo( "call to method getOMClass using ");
|
||||
|
||||
|
||||
//checking method 'doInsert'
|
||||
$t->is ( $aMethods[14], 'doInsert', 'doInsert() is callable' );
|
||||
|
||||
//$result = $obj->doInsert ( $values, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doInsert ');
|
||||
$t->todo( "call to method doInsert using $values, $con ");
|
||||
|
||||
|
||||
//checking method 'doUpdate'
|
||||
$t->is ( $aMethods[15], 'doUpdate', 'doUpdate() is callable' );
|
||||
|
||||
//$result = $obj->doUpdate ( $values, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doUpdate ');
|
||||
$t->todo( "call to method doUpdate using $values, $con ");
|
||||
|
||||
|
||||
//checking method 'doDeleteAll'
|
||||
$t->is ( $aMethods[16], 'doDeleteAll', 'doDeleteAll() is callable' );
|
||||
|
||||
//$result = $obj->doDeleteAll ( $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doDeleteAll ');
|
||||
$t->todo( "call to method doDeleteAll using $con ");
|
||||
|
||||
|
||||
//checking method 'doDelete'
|
||||
$t->is ( $aMethods[17], 'doDelete', 'doDelete() is callable' );
|
||||
|
||||
//$result = $obj->doDelete ( $values, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doDelete ');
|
||||
$t->todo( "call to method doDelete using $values, $con ");
|
||||
|
||||
|
||||
//checking method 'doValidate'
|
||||
$t->is ( $aMethods[18], 'doValidate', 'doValidate() is callable' );
|
||||
|
||||
//$result = $obj->doValidate ( $obj, $cols);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doValidate ');
|
||||
$t->todo( "call to method doValidate using $obj, $cols ");
|
||||
|
||||
|
||||
//checking method 'retrieveByPK'
|
||||
$t->is ( $aMethods[19], 'retrieveByPK', 'retrieveByPK() is callable' );
|
||||
|
||||
//$result = $obj->retrieveByPK ( $pk, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method retrieveByPK ');
|
||||
$t->todo( "call to method retrieveByPK using $pk, $con ");
|
||||
|
||||
|
||||
//checking method 'retrieveByPKs'
|
||||
$t->is ( $aMethods[20], 'retrieveByPKs', 'retrieveByPKs() is callable' );
|
||||
|
||||
//$result = $obj->retrieveByPKs ( $pks, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method retrieveByPKs ');
|
||||
$t->todo( "call to method retrieveByPKs using $pks, $con ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classBasePeerTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'BasePeer');
|
||||
|
||||
|
||||
$obj = new BasePeer ($dbc);
|
||||
$t = new lime_test( 31, new lime_output_color() );
|
||||
|
||||
$className = BasePeer;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
//To change the case only the first letter of each word, TIA
|
||||
$className = ucwords($className);
|
||||
$t->diag("class $className" );
|
||||
|
||||
$t->isa_ok( $obj , $className, "class $className created");
|
||||
|
||||
$t->is( count($methods) , 14, "class $className have " . 14 . ' methods.' );
|
||||
|
||||
//checking method 'getFieldnames'
|
||||
$t->can_ok( $obj, 'getFieldnames', 'getFieldnames() is callable' );
|
||||
|
||||
//$result = $obj->getFieldnames ( $classname, $type);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getFieldnames ');
|
||||
$t->todo( "call to method getFieldnames using $classname, $type ");
|
||||
|
||||
|
||||
//checking method 'translateFieldname'
|
||||
$t->can_ok( $obj, 'translateFieldname', 'translateFieldname() is callable' );
|
||||
|
||||
//$result = $obj->translateFieldname ( $classname, $fieldname, $fromType, $toType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method translateFieldname ');
|
||||
$t->todo( "call to method translateFieldname using $classname, $fieldname, $fromType, $toType ");
|
||||
|
||||
|
||||
//checking method 'doDelete'
|
||||
$t->can_ok( $obj, 'doDelete', 'doDelete() is callable' );
|
||||
|
||||
//$result = $obj->doDelete ( $criteria, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doDelete ');
|
||||
$t->todo( "call to method doDelete using $criteria, $con ");
|
||||
|
||||
|
||||
//checking method 'doDeleteAll'
|
||||
$t->can_ok( $obj, 'doDeleteAll', 'doDeleteAll() is callable' );
|
||||
|
||||
//$result = $obj->doDeleteAll ( $tableName, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doDeleteAll ');
|
||||
$t->todo( "call to method doDeleteAll using $tableName, $con ");
|
||||
|
||||
|
||||
//checking method 'doInsert'
|
||||
$t->can_ok( $obj, 'doInsert', 'doInsert() is callable' );
|
||||
|
||||
//$result = $obj->doInsert ( $criteria, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doInsert ');
|
||||
$t->todo( "call to method doInsert using $criteria, $con ");
|
||||
|
||||
|
||||
//checking method 'doUpdate'
|
||||
$t->can_ok( $obj, 'doUpdate', 'doUpdate() is callable' );
|
||||
|
||||
//$result = $obj->doUpdate ( $selectCriteria, $updateValues, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doUpdate ');
|
||||
$t->todo( "call to method doUpdate using $selectCriteria, $updateValues, $con ");
|
||||
|
||||
|
||||
//checking method 'doSelect'
|
||||
$t->can_ok( $obj, 'doSelect', 'doSelect() is callable' );
|
||||
|
||||
//$result = $obj->doSelect ( $criteria, $con);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doSelect ');
|
||||
$t->todo( "call to method doSelect using $criteria, $con ");
|
||||
|
||||
|
||||
//checking method 'doValidate'
|
||||
$t->can_ok( $obj, 'doValidate', 'doValidate() is callable' );
|
||||
|
||||
//$result = $obj->doValidate ( $dbName, $tableName, $columns);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method doValidate ');
|
||||
$t->todo( "call to method doValidate using $dbName, $tableName, $columns ");
|
||||
|
||||
|
||||
//checking method 'getPrimaryKey'
|
||||
$t->can_ok( $obj, 'getPrimaryKey', 'getPrimaryKey() is callable' );
|
||||
|
||||
//$result = $obj->getPrimaryKey ( $criteria);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getPrimaryKey ');
|
||||
$t->todo( "call to method getPrimaryKey using $criteria ");
|
||||
|
||||
|
||||
//checking method 'createSelectSql'
|
||||
$t->can_ok( $obj, 'createSelectSql', 'createSelectSql() is callable' );
|
||||
|
||||
//$result = $obj->createSelectSql ( $criteria, $params);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method createSelectSql ');
|
||||
$t->todo( "call to method createSelectSql using $criteria, $params ");
|
||||
|
||||
|
||||
//checking method 'buildParams'
|
||||
$t->can_ok( $obj, 'buildParams', 'buildParams() is callable' );
|
||||
|
||||
//$result = $obj->buildParams ( $columns, $values);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method buildParams ');
|
||||
$t->todo( "call to method buildParams using $columns, $values ");
|
||||
|
||||
|
||||
//checking method 'populateStmtValues'
|
||||
$t->can_ok( $obj, 'populateStmtValues', 'populateStmtValues() is callable' );
|
||||
|
||||
//$result = $obj->populateStmtValues ( $stmt, $params, $dbMap);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method populateStmtValues ');
|
||||
$t->todo( "call to method populateStmtValues using $stmt, $params, $dbMap ");
|
||||
|
||||
|
||||
//checking method 'getValidator'
|
||||
$t->can_ok( $obj, 'getValidator', 'getValidator() is callable' );
|
||||
|
||||
//$result = $obj->getValidator ( $classname);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getValidator ');
|
||||
$t->todo( "call to method getValidator using $classname ");
|
||||
|
||||
|
||||
//checking method 'getMapBuilder'
|
||||
$t->can_ok( $obj, 'getMapBuilder', 'getMapBuilder() is callable' );
|
||||
|
||||
//$result = $obj->getMapBuilder ( $classname);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getMapBuilder ');
|
||||
$t->todo( "call to method getMapBuilder using $classname ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
@@ -1,638 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classCasesTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php';
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'case');
|
||||
|
||||
|
||||
//$obj = new Cases ($dbc);
|
||||
$t = new lime_test( 3, new lime_output_color() );
|
||||
|
||||
$className = "Cases";
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
|
||||
$className = ucwords($className);
|
||||
$t->diag("class $className" );
|
||||
|
||||
$t->is( count($methods) , 75, "class $className have " . 73 . ' methods.' );
|
||||
|
||||
// Methods
|
||||
$aMethods = array_keys ( $methods );
|
||||
|
||||
|
||||
/*
|
||||
//checking method 'canStartCase'
|
||||
$t->is ( $aMethods[0], 'canStartCase', 'canStartCase() is callable' );
|
||||
|
||||
//$result = $obj->canStartCase ( $sUIDUser);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method canStartCase ');
|
||||
$t->todo( "call to method canStartCase using $sUIDUser ");
|
||||
|
||||
|
||||
//checking method 'getStartCases'
|
||||
$t->is ( $aMethods[1], 'getStartCases', 'getStartCases() is callable' );
|
||||
|
||||
//$result = $obj->getStartCases ( $sUIDUser);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getStartCases ');
|
||||
$t->todo( "call to method getStartCases using $sUIDUser ");
|
||||
|
||||
//checking method 'loadCase'
|
||||
$t->is ( $aMethods[2], 'loadCase', 'loadCase() is callable' );
|
||||
|
||||
//$result = $obj->loadCase ( $sAppUid, $iDelIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method loadCase ');
|
||||
$t->todo( "call to method loadCase using $sAppUid, $iDelIndex ");
|
||||
|
||||
|
||||
//checking method 'loadCaseByNumber'
|
||||
$t->is ( $aMethods[3], 'loadCaseByNumber', 'loadCaseByNumber() is callable' );
|
||||
|
||||
//$result = $obj->loadCaseByNumber ( $sCaseNumber);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method loadCaseByNumber ');
|
||||
$t->todo( "call to method loadCaseByNumber using $sCaseNumber ");
|
||||
|
||||
|
||||
//checking method 'refreshCaseLabel'
|
||||
$t->is ( $aMethods[4], 'refreshCaseLabel', 'refreshCaseLabel() is callable' );
|
||||
|
||||
//$result = $obj->refreshCaseLabel ( $sAppUid, $aAppData, $sLabel);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method refreshCaseLabel ');
|
||||
$t->todo( "call to method refreshCaseLabel using $sAppUid, $aAppData, $sLabel ");
|
||||
|
||||
|
||||
//checking method 'refreshCaseTitle'
|
||||
$t->is ( $aMethods[5], 'refreshCaseTitle', 'refreshCaseTitle() is callable' );
|
||||
|
||||
//$result = $obj->refreshCaseTitle ( $sAppUid, $aAppData);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method refreshCaseTitle ');
|
||||
$t->todo( "call to method refreshCaseTitle using $sAppUid, $aAppData ");
|
||||
|
||||
|
||||
//checking method 'refreshCaseDescription'
|
||||
$t->is ( $aMethods[6], 'refreshCaseDescription', 'refreshCaseDescription() is callable' );
|
||||
|
||||
//$result = $obj->refreshCaseDescription ( $sAppUid, $aAppData);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method refreshCaseDescription ');
|
||||
$t->todo( "call to method refreshCaseDescription using $sAppUid, $aAppData ");
|
||||
|
||||
|
||||
//checking method 'refreshCaseStatusCode'
|
||||
$t->is ( $aMethods[7], 'refreshCaseStatusCode', 'refreshCaseStatusCode() is callable' );
|
||||
|
||||
//$result = $obj->refreshCaseStatusCode ( $sAppUid, $aAppData);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method refreshCaseStatusCode ');
|
||||
$t->todo( "call to method refreshCaseStatusCode using $sAppUid, $aAppData ");
|
||||
|
||||
|
||||
//checking method 'updateCase'
|
||||
$t->is ( $aMethods[8], 'updateCase', 'updateCase() is callable' );
|
||||
|
||||
//$result = $obj->updateCase ( $sAppUid, $Fields);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method updateCase ');
|
||||
$t->todo( "call to method updateCase using $sAppUid, $Fields ");
|
||||
|
||||
|
||||
//checking method 'removeCase'
|
||||
$t->is ( $aMethods[9], 'removeCase', 'removeCase() is callable' );
|
||||
|
||||
//$result = $obj->removeCase ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method removeCase ');
|
||||
$t->todo( "call to method removeCase using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'setDelInitDate'
|
||||
$t->is ( $aMethods[10], 'setDelInitDate', 'setDelInitDate() is callable' );
|
||||
|
||||
//$result = $obj->setDelInitDate ( $sAppUid, $iDelIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method setDelInitDate ');
|
||||
$t->todo( "call to method setDelInitDate using $sAppUid, $iDelIndex ");
|
||||
|
||||
|
||||
//checking method 'GetOpenThreads'
|
||||
$t->is ( $aMethods[11], 'GetOpenThreads', 'GetOpenThreads() is callable' );
|
||||
|
||||
//$result = $obj->GetOpenThreads ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method GetOpenThreads ');
|
||||
$t->todo( "call to method GetOpenThreads using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'getSiblingThreads'
|
||||
$t->is ( $aMethods[12], 'getSiblingThreads', 'getSiblingThreads() is callable' );
|
||||
|
||||
//$result = $obj->getSiblingThreads ( $sAppUid, $iDelIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getSiblingThreads ');
|
||||
$t->todo( "call to method getSiblingThreads using $sAppUid, $iDelIndex ");
|
||||
|
||||
|
||||
//checking method 'getOpenSiblingThreads'
|
||||
$t->is ( $aMethods[13], 'getOpenSiblingThreads', 'getOpenSiblingThreads() is callable' );
|
||||
|
||||
//$result = $obj->getOpenSiblingThreads ( $sNextTask, $sAppUid, $iDelIndex, $sCurrentTask);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getOpenSiblingThreads ');
|
||||
$t->todo( "call to method getOpenSiblingThreads using $sNextTask, $sAppUid, $iDelIndex, $sCurrentTask ");
|
||||
|
||||
|
||||
//checking method 'CountTotalPreviousTasks'
|
||||
$t->is ( $aMethods[14], 'CountTotalPreviousTasks', 'CountTotalPreviousTasks() is callable' );
|
||||
|
||||
//$result = $obj->CountTotalPreviousTasks ( $sTasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method CountTotalPreviousTasks ');
|
||||
$t->todo( "call to method CountTotalPreviousTasks using $sTasUid ");
|
||||
|
||||
|
||||
//checking method 'getOpenNullDelegations'
|
||||
$t->is ( $aMethods[15], 'getOpenNullDelegations', 'getOpenNullDelegations() is callable' );
|
||||
|
||||
//$result = $obj->getOpenNullDelegations ( $sAppUid, $sTasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getOpenNullDelegations ');
|
||||
$t->todo( "call to method getOpenNullDelegations using $sAppUid, $sTasUid ");
|
||||
|
||||
|
||||
//checking method 'isRouteOpen'
|
||||
$t->is ( $aMethods[16], 'isRouteOpen', 'isRouteOpen() is callable' );
|
||||
|
||||
//$result = $obj->isRouteOpen ( $sAppUid, $sTasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method isRouteOpen ');
|
||||
$t->todo( "call to method isRouteOpen using $sAppUid, $sTasUid ");
|
||||
|
||||
|
||||
//checking method 'newAppDelegation'
|
||||
$t->is ( $aMethods[17], 'newAppDelegation', 'newAppDelegation() is callable' );
|
||||
|
||||
//$result = $obj->newAppDelegation ( $sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method newAppDelegation ');
|
||||
$t->todo( "call to method newAppDelegation using $sProUid, $sAppUid, $sTasUid, $sUsrUid, $sPrevious, $iPriority, $sDelType, $iAppThreadIndex ");
|
||||
|
||||
|
||||
//checking method 'updateAppDelegation'
|
||||
$t->is ( $aMethods[18], 'updateAppDelegation', 'updateAppDelegation() is callable' );
|
||||
|
||||
//$result = $obj->updateAppDelegation ( $sAppUid, $iDelIndex, $iAppThreadIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method updateAppDelegation ');
|
||||
$t->todo( "call to method updateAppDelegation using $sAppUid, $iDelIndex, $iAppThreadIndex ");
|
||||
|
||||
|
||||
//checking method 'GetAllDelegations'
|
||||
$t->is ( $aMethods[19], 'GetAllDelegations', 'GetAllDelegations() is callable' );
|
||||
|
||||
//$result = $obj->GetAllDelegations ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method GetAllDelegations ');
|
||||
$t->todo( "call to method GetAllDelegations using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'GetAllThreads'
|
||||
$t->is ( $aMethods[20], 'GetAllThreads', 'GetAllThreads() is callable' );
|
||||
|
||||
//$result = $obj->GetAllThreads ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method GetAllThreads ');
|
||||
$t->todo( "call to method GetAllThreads using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'updateAppThread'
|
||||
$t->is ( $aMethods[21], 'updateAppThread', 'updateAppThread() is callable' );
|
||||
|
||||
//$result = $obj->updateAppThread ( $sAppUid, $iAppThreadIndex, $iNewDelIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method updateAppThread ');
|
||||
$t->todo( "call to method updateAppThread using $sAppUid, $iAppThreadIndex, $iNewDelIndex ");
|
||||
|
||||
|
||||
//checking method 'closeAppThread'
|
||||
$t->is ( $aMethods[22], 'closeAppThread', 'closeAppThread() is callable' );
|
||||
|
||||
//$result = $obj->closeAppThread ( $sAppUid, $iAppThreadIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method closeAppThread ');
|
||||
$t->todo( "call to method closeAppThread using $sAppUid, $iAppThreadIndex ");
|
||||
|
||||
|
||||
//checking method 'closeAllThreads'
|
||||
$t->is ( $aMethods[23], 'closeAllThreads', 'closeAllThreads() is callable' );
|
||||
|
||||
//$result = $obj->closeAllThreads ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method closeAllThreads ');
|
||||
$t->todo( "call to method closeAllThreads using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'newAppThread'
|
||||
$t->is ( $aMethods[24], 'newAppThread', 'newAppThread() is callable' );
|
||||
|
||||
//$result = $obj->newAppThread ( $sAppUid, $iNewDelIndex, $iAppParent);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method newAppThread ');
|
||||
$t->todo( "call to method newAppThread using $sAppUid, $iNewDelIndex, $iAppParent ");
|
||||
|
||||
|
||||
//checking method 'closeAllDelegations'
|
||||
$t->is ( $aMethods[25], 'closeAllDelegations', 'closeAllDelegations() is callable' );
|
||||
|
||||
//$result = $obj->closeAllDelegations ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method closeAllDelegations ');
|
||||
$t->todo( "call to method closeAllDelegations using $sAppUid ");
|
||||
|
||||
|
||||
//checking method 'CloseCurrentDelegation'
|
||||
$t->is ( $aMethods[26], 'CloseCurrentDelegation', 'CloseCurrentDelegation() is callable' );
|
||||
|
||||
//$result = $obj->CloseCurrentDelegation ( $sAppUid, $iDelIndex);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method CloseCurrentDelegation ');
|
||||
$t->todo( "call to method CloseCurrentDelegation using $sAppUid, $iDelIndex ");
|
||||
|
||||
|
||||
//checking method 'ReactivateCurrentDelegation'
|
||||
$t->is ( $aMethods[27], 'ReactivateCurrentDelegation', 'ReactivateCurrentDelegation() is callable' );
|
||||
|
||||
//$result = $obj->ReactivateCurrentDelegation ( $sAppUid, $iDelegation);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method ReactivateCurrentDelegation ');
|
||||
$t->todo( "call to method ReactivateCurrentDelegation using $sAppUid, $iDelegation ");
|
||||
|
||||
|
||||
//checking method 'startCase'
|
||||
$t->is ( $aMethods[28], 'startCase', 'startCase() is callable' );
|
||||
|
||||
//$result = $obj->startCase ( $sTasUid, $sUsrUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method startCase ');
|
||||
$t->todo( "call to method startCase using $sTasUid, $sUsrUid ");
|
||||
|
||||
|
||||
//checking method 'getNextStep'
|
||||
$t->is ( $aMethods[29], 'getNextStep', 'getNextStep() is callable' );
|
||||
|
||||
//$result = $obj->getNextStep ( $sProUid, $sAppUid, $iDelIndex, $iPosition);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getNextStep ');
|
||||
$t->todo( "call to method getNextStep using $sProUid, $sAppUid, $iDelIndex, $iPosition ");
|
||||
|
||||
|
||||
//checking method 'getPreviousStep'
|
||||
$t->is ( $aMethods[30], 'getPreviousStep', 'getPreviousStep() is callable' );
|
||||
|
||||
//$result = $obj->getPreviousStep ( $sProUid, $sAppUid, $iDelIndex, $iPosition);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getPreviousStep ');
|
||||
$t->todo( "call to method getPreviousStep using $sProUid, $sAppUid, $iDelIndex, $iPosition ");
|
||||
|
||||
|
||||
//checking method 'getNextSupervisorStep'
|
||||
$t->is ( $aMethods[31], 'getNextSupervisorStep', 'getNextSupervisorStep() is callable' );
|
||||
|
||||
//$result = $obj->getNextSupervisorStep ( $sProcessUID, $iPosition, $sType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getNextSupervisorStep ');
|
||||
$t->todo( "call to method getNextSupervisorStep using $sProcessUID, $iPosition, $sType ");
|
||||
|
||||
|
||||
//checking method 'getPreviousSupervisorStep'
|
||||
$t->is ( $aMethods[32], 'getPreviousSupervisorStep', 'getPreviousSupervisorStep() is callable' );
|
||||
|
||||
//$result = $obj->getPreviousSupervisorStep ( $sProcessUID, $iPosition, $sType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getPreviousSupervisorStep ');
|
||||
$t->todo( "call to method getPreviousSupervisorStep using $sProcessUID, $iPosition, $sType ");
|
||||
|
||||
|
||||
//checking method 'getTransferHistoryCriteria'
|
||||
$t->is ( $aMethods[33], 'getTransferHistoryCriteria', 'getTransferHistoryCriteria() is callable' );
|
||||
|
||||
//$result = $obj->getTransferHistoryCriteria ( $sAppUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getTransferHistoryCriteria ');
|
||||
$t->todo( "call to method getTransferHistoryCriteria using $sAppUid ");
|
||||
|
||||
//checking method 'prepareCriteriaForToDo'
|
||||
$t->is ( $aMethods[34], 'prepareCriteriaForToDo', 'prepareCriteriaForToDo() is callable' );
|
||||
|
||||
//$result = $obj->getConditionCasesList ( $sTypeList, $sUIDUserLogged);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getConditionCasesList ');
|
||||
$t->todo( "call to method prepareCriteriaForToDo using $sTypeList, $sUIDUserLogged ");
|
||||
|
||||
|
||||
//checking method 'getConditionCasesList'
|
||||
$t->is ( $aMethods[35], 'getConditionCasesList', 'getConditionCasesList() is callable' );
|
||||
|
||||
//$result = $obj->getConditionCasesList ( $sTypeList, $sUIDUserLogged);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getConditionCasesList ');
|
||||
$t->todo( "call to method getConditionCasesList using $sTypeList, $sUIDUserLogged ");
|
||||
|
||||
|
||||
//checking method 'ThrowUnpauseDaemon'
|
||||
$t->is ( $aMethods[36], 'ThrowUnpauseDaemon', 'ThrowUnpauseDaemon() is callable' );
|
||||
|
||||
//$result = $obj->ThrowUnpauseDaemon ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method ThrowUnpauseDaemon ');
|
||||
$t->todo( "call to method ThrowUnpauseDaemon using ");
|
||||
|
||||
|
||||
//checking method 'getApplicationUIDByNumber'
|
||||
$t->is ( $aMethods[37], 'getApplicationUIDByNumber', 'getApplicationUIDByNumber() is callable' );
|
||||
|
||||
//$result = $obj->getApplicationUIDByNumber ( $iApplicationNumber);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getApplicationUIDByNumber ');
|
||||
$t->todo( "call to method getApplicationUIDByNumber using $iApplicationNumber ");
|
||||
|
||||
|
||||
//checking method 'getCurrentDelegation'
|
||||
$t->is ( $aMethods[38], 'getCurrentDelegation', 'getCurrentDelegation() is callable' );
|
||||
|
||||
//$result = $obj->getCurrentDelegation ( $sApplicationUID, $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getCurrentDelegation ');
|
||||
$t->todo( "call to method getCurrentDelegation using $sApplicationUID, $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'loadTriggers'
|
||||
$t->is ( $aMethods[39], 'loadTriggers', 'loadTriggers() is callable' );
|
||||
|
||||
//$result = $obj->loadTriggers ( $sTasUid, $sStepType, $sStepUidObj, $sTriggerType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method loadTriggers ');
|
||||
$t->todo( "call to method loadTriggers using $sTasUid, $sStepType, $sStepUidObj, $sTriggerType ");
|
||||
|
||||
|
||||
//checking method 'executeTriggers'
|
||||
$t->is ( $aMethods[40], 'executeTriggers', 'executeTriggers() is callable' );
|
||||
|
||||
//$result = $obj->executeTriggers ( $sTasUid, $sStepType, $sStepUidObj, $sTriggerType, $aFields);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method executeTriggers ');
|
||||
$t->todo( "call to method executeTriggers using $sTasUid, $sStepType, $sStepUidObj, $sTriggerType, $aFields ");
|
||||
|
||||
|
||||
//checking method 'getTriggerNames'
|
||||
$t->is ( $aMethods[41], 'getTriggerNames', 'getTriggerNames() is callable' );
|
||||
|
||||
//$result = $obj->getTriggerNames ( $triggers);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getTriggerNames ');
|
||||
$t->todo( "call to method getTriggerNames using $triggers ");
|
||||
|
||||
|
||||
//checking method 'getInputDocumentsCriteria'
|
||||
$t->is ( $aMethods[42], 'getInputDocumentsCriteria', 'getInputDocumentsCriteria() is callable' );
|
||||
|
||||
//$result = $obj->getInputDocumentsCriteria ( $sApplicationUID, $iDelegation, $sDocumentUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getInputDocumentsCriteria ');
|
||||
$t->todo( "call to method getInputDocumentsCriteria using $sApplicationUID, $iDelegation, $sDocumentUID ");
|
||||
|
||||
//checking method 'getInputDocumentsCriteriaToRevise'
|
||||
$t->is ( $aMethods[43], 'getInputDocumentsCriteriaToRevise', 'getInputDocumentsCriteriaToRevise() is callable' );
|
||||
|
||||
//$result = $obj->getInputDocumentsCriteriaToRevise ( $sApplicationUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getInputDocumentsCriteriaToRevise ');
|
||||
$t->todo( "call to method getInputDocumentsCriteriaToRevise using $sApplicationUID ");
|
||||
|
||||
|
||||
//checking method 'getOutputDocumentsCriteriaToRevise'
|
||||
$t->is ( $aMethods[44], 'getOutputDocumentsCriteriaToRevise', 'getOutputDocumentsCriteriaToRevise() is callable' );
|
||||
|
||||
//$result = $obj->getOutputDocumentsCriteriaToRevise ( $sApplicationUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getOutputDocumentsCriteriaToRevise ');
|
||||
$t->todo( "call to method getOutputDocumentsCriteriaToRevise using $sApplicationUID ");
|
||||
|
||||
|
||||
//checking method 'getCriteriaProcessCases'
|
||||
$t->is ( $aMethods[45], 'getCriteriaProcessCases', 'getCriteriaProcessCases() is callable' );
|
||||
|
||||
//$result = $obj->getCriteriaProcessCases ( $status, $PRO_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getCriteriaProcessCases ');
|
||||
$t->todo( "call to method getCriteriaProcessCases using $status, $PRO_UID ");
|
||||
|
||||
|
||||
//checking method 'pauseCase'
|
||||
$t->is ( $aMethods[46], 'pauseCase', 'pauseCase() is callable' );
|
||||
|
||||
//$result = $obj->pauseCase ( $sApplicationUID, $iDelegation, $sUserUID, $sUnpauseDate);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method pauseCase ');
|
||||
$t->todo( "call to method pauseCase using $sApplicationUID, $iDelegation, $sUserUID, $sUnpauseDate ");
|
||||
|
||||
|
||||
//checking method 'unpauseCase'
|
||||
$t->is ( $aMethods[47], 'unpauseCase', 'unpauseCase() is callable' );
|
||||
|
||||
//$result = $obj->unpauseCase ( $sApplicationUID, $iDelegation, $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method unpauseCase ');
|
||||
$t->todo( "call to method unpauseCase using $sApplicationUID, $iDelegation, $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'cancelCase'
|
||||
$t->is ( $aMethods[48], 'cancelCase', 'cancelCase() is callable' );
|
||||
|
||||
//$result = $obj->cancelCase ( $sApplicationUID, $iIndex, $user_logged);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method cancelCase ');
|
||||
$t->todo( "call to method cancelCase using $sApplicationUID, $iIndex, $user_logged ");
|
||||
|
||||
|
||||
//checking method 'reactivateCase'
|
||||
$t->is ( $aMethods[49], 'reactivateCase', 'reactivateCase() is callable' );
|
||||
|
||||
//$result = $obj->reactivateCase ( $sApplicationUID, $iIndex, $user_logged);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method reactivateCase ');
|
||||
$t->todo( "call to method reactivateCase using $sApplicationUID, $iIndex, $user_logged ");
|
||||
|
||||
|
||||
//checking method 'reassignCase'
|
||||
$t->is ( $aMethods[50], 'reassignCase', 'reassignCase() is callable' );
|
||||
|
||||
//$result = $obj->reassignCase ( $sApplicationUID, $iDelegation, $sUserUID, $newUserUID, $sType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method reassignCase ');
|
||||
$t->todo( "call to method reassignCase using $sApplicationUID, $iDelegation, $sUserUID, $newUserUID, $sType ");
|
||||
|
||||
|
||||
//checking method 'getAllDynaformsStepsToRevise'
|
||||
$t->is ( $aMethods[51], 'getAllDynaformsStepsToRevise', 'getAllDynaformsStepsToRevise() is callable' );
|
||||
|
||||
//$result = $obj->getAllDynaformsStepsToRevise ( $APP_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllDynaformsStepsToRevise ');
|
||||
$t->todo( "call to method getAllDynaformsStepsToRevise using $APP_UID ");
|
||||
|
||||
|
||||
//checking method 'getAllInputsStepsToRevise'
|
||||
$t->is ( $aMethods[52], 'getAllInputsStepsToRevise', 'getAllInputsStepsToRevise() is callable' );
|
||||
|
||||
//$result = $obj->getAllInputsStepsToRevise ( $APP_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllInputsStepsToRevise ');
|
||||
$t->todo( "call to method getAllInputsStepsToRevise using $APP_UID ");
|
||||
|
||||
|
||||
//checking method 'getAllUploadedDocumentsCriteria'
|
||||
$t->is ( $aMethods[53], 'getAllUploadedDocumentsCriteria', 'getAllUploadedDocumentsCriteria() is callable' );
|
||||
|
||||
//$result = $obj->getAllUploadedDocumentsCriteria ( $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllUploadedDocumentsCriteria ');
|
||||
$t->todo( "call to method getAllUploadedDocumentsCriteria using $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'getAllGeneratedDocumentsCriteria'
|
||||
$t->is ( $aMethods[54], 'getAllGeneratedDocumentsCriteria', 'getAllGeneratedDocumentsCriteria() is callable' );
|
||||
|
||||
//$result = $obj->getAllGeneratedDocumentsCriteria ( $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllGeneratedDocumentsCriteria ');
|
||||
$t->todo( "call to method getAllGeneratedDocumentsCriteria using $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'getallDynaformsCriteria'
|
||||
$t->is ( $aMethods[55], 'getallDynaformsCriteria', 'getallDynaformsCriteria() is callable' );
|
||||
|
||||
//$result = $obj->getallDynaformsCriteria ( $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getallDynaformsCriteria ');
|
||||
$t->todo( "call to method getallDynaformsCriteria using $sProcessUID, $sApplicationUID, $sTasKUID, $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'sendNotifications'
|
||||
$t->is ( $aMethods[56], 'sendNotifications', 'sendNotifications() is callable' );
|
||||
|
||||
//$result = $obj->sendNotifications ( $sCurrentTask, $aTasks, $aFields, $sApplicationUID, $iDelegation, $sFrom);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method sendNotifications ');
|
||||
$t->todo( "call to method sendNotifications using $sCurrentTask, $aTasks, $aFields, $sApplicationUID, $iDelegation, $sFrom ");
|
||||
|
||||
|
||||
//checking method 'getAllObjects'
|
||||
$t->is ( $aMethods[57], 'getAllObjects', 'getAllObjects() is callable' );
|
||||
|
||||
//$result = $obj->getAllObjects ( $PRO_UID, $APP_UID, $TAS_UID, $USR_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllObjects ');
|
||||
$t->todo( "call to method getAllObjects using $PRO_UID, $APP_UID, $TAS_UID, $USR_UID ");
|
||||
|
||||
|
||||
//checking method 'getAllObjectsFrom'
|
||||
$t->is ( $aMethods[58], 'getAllObjectsFrom', 'getAllObjectsFrom() is callable' );
|
||||
|
||||
//$result = $obj->getAllObjectsFrom ( $PRO_UID, $APP_UID, $TAS_UID, $USR_UID, $ACTION);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllObjectsFrom ');
|
||||
$t->todo( "call to method getAllObjectsFrom using $PRO_UID, $APP_UID, $TAS_UID, $USR_UID, $ACTION ");
|
||||
|
||||
|
||||
//checking method 'verifyCaseTracker'
|
||||
$t->is ( $aMethods[59], 'verifyCaseTracker', 'verifyCaseTracker() is callable' );
|
||||
|
||||
//$result = $obj->verifyCaseTracker ( $case, $pin);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method verifyCaseTracker ');
|
||||
$t->todo( "call to method verifyCaseTracker using $case, $pin ");
|
||||
|
||||
|
||||
//checking method 'Permisos'
|
||||
$t->is ( $aMethods[60], 'Permisos', 'Permisos() is callable' );
|
||||
|
||||
//$result = $obj->caseTrackerPermissions ( $PRO_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Permisos ');
|
||||
$t->todo( "call to method Permisos using $PRO_UID ");
|
||||
|
||||
|
||||
//checking method 'verifyTable'
|
||||
$t->is ( $aMethods[61], 'verifyTable', 'verifyTable() is callable' );
|
||||
|
||||
//$result = $obj->verifyTable ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method verifyTable ');
|
||||
$t->todo( "call to method verifyTable using ");
|
||||
|
||||
|
||||
//checking method 'getAllUploadedDocumentsCriteriaTracker'
|
||||
$t->is ( $aMethods[62], 'getAllUploadedDocumentsCriteriaTracker', 'getAllUploadedDocumentsCriteriaTracker() is callable' );
|
||||
|
||||
//$result = $obj->getAllUploadedDocumentsCriteriaTracker ( $sProcessUID, $sApplicationUID, $sDocUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllUploadedDocumentsCriteriaTracker ');
|
||||
$t->todo( "call to method getAllUploadedDocumentsCriteriaTracker using $sProcessUID, $sApplicationUID, $sDocUID ");
|
||||
|
||||
|
||||
//checking method 'getAllGeneratedDocumentsCriteriaTracker'
|
||||
$t->is ( $aMethods[63], 'getAllGeneratedDocumentsCriteriaTracker', 'getAllGeneratedDocumentsCriteriaTracker() is callable' );
|
||||
|
||||
//$result = $obj->getAllGeneratedDocumentsCriteriaTracker ( $sProcessUID, $sApplicationUID, $sDocUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllGeneratedDocumentsCriteriaTracker ');
|
||||
$t->todo( "call to method getAllGeneratedDocumentsCriteriaTracker using $sProcessUID, $sApplicationUID, $sDocUID ");
|
||||
|
||||
|
||||
//checking method 'getHistoryMessagesTracker'
|
||||
$t->is ( $aMethods[64], 'getHistoryMessagesTracker', 'getHistoryMessagesTracker() is callable' );
|
||||
|
||||
//$result = $obj->getHistoryMessagesTracker ( $sApplicationUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getHistoryMessagesTracker ');
|
||||
$t->todo( "call to method getHistoryMessagesTracker using $sApplicationUID ");
|
||||
|
||||
|
||||
//checking method 'getHistoryMessagesTrackerView'
|
||||
$t->is ( $aMethods[65], 'getHistoryMessagesTrackerView', 'getHistoryMessagesTrackerView() is callable' );
|
||||
|
||||
//$result = $obj->getHistoryMessagesTrackerView ( $sApplicationUID, $Msg_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getHistoryMessagesTrackerView ');
|
||||
$t->todo( "call to method getHistoryMessagesTrackerView using $sApplicationUID, $Msg_UID ");
|
||||
|
||||
|
||||
//checking method 'getAllObjectsFromProcess'
|
||||
$t->is ( $aMethods[66], 'getAllObjectsFromProcess', 'getAllObjectsFromProcess() is callable' );
|
||||
|
||||
//$result = $obj->getAllObjectsFromProcess ( $PRO_UID, $OBJ_TYPE);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllObjectsFromProcess ');
|
||||
$t->todo( "call to method getAllObjectsFromProcess using $PRO_UID, $OBJ_TYPE ");
|
||||
|
||||
|
||||
//checking method 'executeTriggersAfterExternal'
|
||||
$t->is ( $aMethods[67], 'executeTriggersAfterExternal', 'executeTriggersAfterExternal() is callable' );
|
||||
|
||||
//$result = $obj->executeTriggersAfterExternal ( $sProcess, $sTask, $sApplication, $iIndex, $iStepPosition, $aNewData);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method executeTriggersAfterExternal ');
|
||||
$t->todo( "call to method executeTriggersAfterExternal using $sProcess, $sTask, $sApplication, $iIndex, $iStepPosition, $aNewData ");
|
||||
|
||||
|
||||
//checking method 'thisIsTheCurrentUser'
|
||||
$t->is ( $aMethods[68], 'thisIsTheCurrentUser', 'thisIsTheCurrentUser() is callable' );
|
||||
|
||||
//$result = $obj->thisIsTheCurrentUser ( $sApplicationUID, $iIndex, $sUserUID, $sAction, $sURL);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method thisIsTheCurrentUser ');
|
||||
$t->todo( "call to method thisIsTheCurrentUser using $sApplicationUID, $iIndex, $sUserUID, $sAction, $sURL ");
|
||||
|
||||
|
||||
//checking method 'getCriteriaUsersCases'
|
||||
$t->is ( $aMethods[69], 'getCriteriaUsersCases', 'getCriteriaUsersCases() is callable' );
|
||||
|
||||
//$result = $obj->getCriteriaUsersCases ( $status, $USR_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getCriteriaUsersCases ');
|
||||
$t->todo( "call to method getCriteriaUsersCases using $status, $USR_UID ");
|
||||
|
||||
|
||||
//checking method 'getAdvancedSearch'
|
||||
$t->is ( $aMethods[70], 'getAdvancedSearch', 'getAdvancedSearch() is callable' );
|
||||
|
||||
//$result = $obj->getAdvancedSearch ( $sCase, $sProcess, $sTask, $sCurrentUser, $sSentby, $sLastModFrom, $sLastModTo, $sStatus, $permisse, $userlogged, $aSupervisor);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAdvancedSearch ');
|
||||
|
||||
*/
|
||||
$t->todo( "call to method getAdvancedSearch using $sCase, $sProcess, $sTask, $sCurrentUser, $sSentby, $sLastModFrom, $sLastModTo, $sStatus, $permisse, $userlogged, $aSupervisor ");
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDashboardsTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
Propel::init( PATH_CORE . "config/databases.php");
|
||||
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'error');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'dashboards');
|
||||
|
||||
$obj = new Dashboards ($dbc);
|
||||
$t = new lime_test( 9, new lime_output_color() );
|
||||
|
||||
$className = Dashboards;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
|
||||
$t->diag('class $className' );
|
||||
$t->isa_ok( $obj , 'Dashboards', 'class $className created');
|
||||
|
||||
$t->is( count($methods) , 3, "class $className have " . 3 . ' methods.' );
|
||||
|
||||
//checking method 'getConfiguration'
|
||||
$t->can_ok( $obj, 'getConfiguration', 'getConfiguration() is callable' );
|
||||
|
||||
//$result = $obj->getConfiguration ( $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getConfiguration ');
|
||||
$t->todo( "call to method getConfiguration using $sUserUID ");
|
||||
|
||||
|
||||
//checking method 'saveConfiguration'
|
||||
$t->can_ok( $obj, 'saveConfiguration', 'saveConfiguration() is callable' );
|
||||
|
||||
//$result = $obj->saveConfiguration ( $sUserUID, $aConfiguration);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method saveConfiguration ');
|
||||
$t->todo( "call to method saveConfiguration using $sUserUID, $aConfiguration ");
|
||||
|
||||
|
||||
//checking method 'getDashboardsObject'
|
||||
$t->can_ok( $obj, 'getDashboardsObject', 'getDashboardsObject() is callable' );
|
||||
|
||||
//$result = $obj->getDashboardsObject ( $sUserUID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getDashboardsObject ');
|
||||
$t->todo( "call to method getDashboardsObject using $sUserUID ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
@@ -1,207 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDatesTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'dates');
|
||||
|
||||
|
||||
$obj = new Dates ($dbc);
|
||||
$t = new lime_test( 37, new lime_output_color() );
|
||||
|
||||
$className = Dates;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
//To change the case only the first letter of each word, TIA
|
||||
//$className = ucwords($className);
|
||||
$t->diag("class $className" );
|
||||
|
||||
$t->isa_ok( $obj , $className, "class $className created");
|
||||
|
||||
$t->is( count($methods) , 17, "class $className have " . 17 . ' methods.' );
|
||||
|
||||
//checking method 'calculateDate'
|
||||
$t->can_ok( $obj, 'calculateDate', 'calculateDate() is callable' );
|
||||
|
||||
//$result = $obj->calculateDate ( $sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid, $ProUid, $TasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method calculateDate ');
|
||||
$t->todo( "call to method calculateDate using $sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid, $ProUid, $TasUid ");
|
||||
|
||||
|
||||
//checking method 'calculateDuration'
|
||||
$t->can_ok( $obj, 'calculateDuration', 'calculateDuration() is callable' );
|
||||
|
||||
//$result = $obj->calculateDuration ( $sInitDate, $sEndDate, $UsrUid, $ProUid, $TasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method calculateDuration ');
|
||||
$t->todo( "call to method calculateDuration using $sInitDate, $sEndDate, $UsrUid, $ProUid, $TasUid ");
|
||||
|
||||
|
||||
//checking method 'prepareInformation'
|
||||
$t->can_ok( $obj, 'prepareInformation', 'prepareInformation() is callable' );
|
||||
|
||||
//$result = $obj->prepareInformation ( $UsrUid, $ProUid, $TasUid);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method prepareInformation ');
|
||||
$t->todo( "call to method prepareInformation using $UsrUid, $ProUid, $TasUid ");
|
||||
|
||||
|
||||
//checking method 'setSkipEveryYear'
|
||||
$t->can_ok( $obj, 'setSkipEveryYear', 'setSkipEveryYear() is callable' );
|
||||
|
||||
//$result = $obj->setSkipEveryYear ( $bSkipEveryYear);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method setSkipEveryYear ');
|
||||
$t->todo( "call to method setSkipEveryYear using $bSkipEveryYear ");
|
||||
|
||||
|
||||
//checking method 'addHoliday'
|
||||
$t->can_ok( $obj, 'addHoliday', 'addHoliday() is callable' );
|
||||
|
||||
//$result = $obj->addHoliday ( $sDate);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method addHoliday ');
|
||||
$t->todo( "call to method addHoliday using $sDate ");
|
||||
|
||||
|
||||
//checking method 'setHolidays'
|
||||
$t->can_ok( $obj, 'setHolidays', 'setHolidays() is callable' );
|
||||
|
||||
//$result = $obj->setHolidays ( $aDates);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method setHolidays ');
|
||||
$t->todo( "call to method setHolidays using $aDates ");
|
||||
|
||||
|
||||
//checking method 'setWeekends'
|
||||
$t->can_ok( $obj, 'setWeekends', 'setWeekends() is callable' );
|
||||
|
||||
//$result = $obj->setWeekends ( $aWeekends);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method setWeekends ');
|
||||
$t->todo( "call to method setWeekends using $aWeekends ");
|
||||
|
||||
|
||||
//checking method 'skipDayOfWeek'
|
||||
$t->can_ok( $obj, 'skipDayOfWeek', 'skipDayOfWeek() is callable' );
|
||||
|
||||
//$result = $obj->skipDayOfWeek ( $iDayNumber);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method skipDayOfWeek ');
|
||||
$t->todo( "call to method skipDayOfWeek using $iDayNumber ");
|
||||
|
||||
|
||||
//checking method 'addNonWorkingRange'
|
||||
$t->can_ok( $obj, 'addNonWorkingRange', 'addNonWorkingRange() is callable' );
|
||||
|
||||
//$result = $obj->addNonWorkingRange ( $sDateA, $sDateB);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method addNonWorkingRange ');
|
||||
$t->todo( "call to method addNonWorkingRange using $sDateA, $sDateB ");
|
||||
|
||||
|
||||
//checking method 'addDays'
|
||||
$t->can_ok( $obj, 'addDays', 'addDays() is callable' );
|
||||
|
||||
//$result = $obj->addDays ( $iInitDate, $iDaysCount, $addSign);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method addDays ');
|
||||
$t->todo( "call to method addDays using $iInitDate, $iDaysCount, $addSign ");
|
||||
|
||||
|
||||
//checking method 'addHours'
|
||||
$t->can_ok( $obj, 'addHours', 'addHours() is callable' );
|
||||
|
||||
//$result = $obj->addHours ( $sInitDate, $iHoursCount, $addSign);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method addHours ');
|
||||
$t->todo( "call to method addHours using $sInitDate, $iHoursCount, $addSign ");
|
||||
|
||||
|
||||
//checking method 'inRange'
|
||||
$t->can_ok( $obj, 'inRange', 'inRange() is callable' );
|
||||
|
||||
//$result = $obj->inRange ( $iDate);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method inRange ');
|
||||
$t->todo( "call to method inRange using $iDate ");
|
||||
|
||||
|
||||
//checking method 'truncateTime'
|
||||
$t->can_ok( $obj, 'truncateTime', 'truncateTime() is callable' );
|
||||
|
||||
//$result = $obj->truncateTime ( $iDate);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method truncateTime ');
|
||||
$t->todo( "call to method truncateTime using $iDate ");
|
||||
|
||||
|
||||
//checking method 'getTime'
|
||||
$t->can_ok( $obj, 'getTime', 'getTime() is callable' );
|
||||
|
||||
//$result = $obj->getTime ( $iDate);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getTime ');
|
||||
$t->todo( "call to method getTime using $iDate ");
|
||||
|
||||
|
||||
//checking method 'setTime'
|
||||
$t->can_ok( $obj, 'setTime', 'setTime() is callable' );
|
||||
|
||||
//$result = $obj->setTime ( $iDate, $aTime);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method setTime ');
|
||||
$t->todo( "call to method setTime using $iDate, $aTime ");
|
||||
|
||||
|
||||
//checking method 'listForYear'
|
||||
$t->can_ok( $obj, 'listForYear', 'listForYear() is callable' );
|
||||
|
||||
//$result = $obj->listForYear ( $iYear);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method listForYear ');
|
||||
$t->todo( "call to method listForYear using $iYear ");
|
||||
|
||||
|
||||
//checking method 'changeYear'
|
||||
$t->can_ok( $obj, 'changeYear', 'changeYear() is callable' );
|
||||
|
||||
//$result = $obj->changeYear ( $iDate, $iYear);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method changeYear ');
|
||||
$t->todo( "call to method changeYear using $iDate, $iYear ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
@@ -1,151 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDbConnectionsTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'dbConnections');
|
||||
|
||||
|
||||
$obj = new DbConnections ($dbc);
|
||||
$t = new lime_test( 23, new lime_output_color() );
|
||||
|
||||
$className = DbConnections;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
//To change the case only the first letter of each word, TIA
|
||||
//$className = ucwords($className);
|
||||
$t->diag("class $className" );
|
||||
|
||||
$t->isa_ok( $obj , $className, "class $className created");
|
||||
|
||||
$t->is( count($methods) , 10, "class $className have " . 10 . ' methods.' );
|
||||
|
||||
//checking method '__construct'
|
||||
$t->can_ok( $obj, '__construct', '__construct() is callable' );
|
||||
|
||||
//$result = $obj->__construct ( $pPRO_UID);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method __construct ');
|
||||
$t->todo( "call to method __construct using $pPRO_UID ");
|
||||
|
||||
|
||||
//checking method 'getAllConnections'
|
||||
$t->can_ok( $obj, 'getAllConnections', 'getAllConnections() is callable' );
|
||||
|
||||
//$result = $obj->getAllConnections ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getAllConnections ');
|
||||
$t->todo( "call to method getAllConnections using ");
|
||||
|
||||
|
||||
//checking method 'getConnections'
|
||||
$t->can_ok( $obj, 'getConnections', 'getConnections() is callable' );
|
||||
|
||||
//$result = $obj->getConnections ( $pType);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getConnections ');
|
||||
$t->todo( "call to method getConnections using $pType ");
|
||||
|
||||
|
||||
//checking method 'loadAdditionalConnections'
|
||||
$t->can_ok( $obj, 'loadAdditionalConnections', 'loadAdditionalConnections() is callable' );
|
||||
|
||||
//$result = $obj->loadAdditionalConnections ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method loadAdditionalConnections ');
|
||||
$t->todo( "call to method loadAdditionalConnections using ");
|
||||
|
||||
|
||||
//checking method 'getDbServicesAvailables'
|
||||
$t->can_ok( $obj, 'getDbServicesAvailables', 'getDbServicesAvailables() is callable' );
|
||||
|
||||
//$result = $obj->getDbServicesAvailables ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getDbServicesAvailables ');
|
||||
$t->todo( "call to method getDbServicesAvailables using ");
|
||||
|
||||
|
||||
//checking method 'showMsg'
|
||||
$t->can_ok( $obj, 'showMsg', 'showMsg() is callable' );
|
||||
|
||||
//$result = $obj->showMsg ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method showMsg ');
|
||||
$t->todo( "call to method showMsg using ");
|
||||
|
||||
|
||||
//checking method 'getEncondeList'
|
||||
$t->can_ok( $obj, 'getEncondeList', 'getEncondeList() is callable' );
|
||||
|
||||
//$result = $obj->getEncondeList ( $engine);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getEncondeList ');
|
||||
$t->todo( "call to method getEncondeList using $engine ");
|
||||
|
||||
|
||||
//checking method 'getErrno'
|
||||
$t->can_ok( $obj, 'getErrno', 'getErrno() is callable' );
|
||||
|
||||
//$result = $obj->getErrno ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getErrno ');
|
||||
$t->todo( "call to method getErrno using ");
|
||||
|
||||
|
||||
//checking method 'getErrmsg'
|
||||
$t->can_ok( $obj, 'getErrmsg', 'getErrmsg() is callable' );
|
||||
|
||||
//$result = $obj->getErrmsg ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method getErrmsg ');
|
||||
$t->todo( "call to method getErrmsg using ");
|
||||
|
||||
|
||||
//checking method 'ordx'
|
||||
$t->can_ok( $obj, 'ordx', 'ordx() is callable' );
|
||||
|
||||
//$result = $obj->ordx ( $m);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method ordx ');
|
||||
$t->todo( "call to method ordx using $m ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classDynaFormFieldTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'error');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
G::LoadSystem ( 'dbconnection');
|
||||
G::LoadSystem ( 'dbsession');
|
||||
G::LoadSystem ( 'dbrecordset');
|
||||
G::LoadSystem ( 'dbtable');
|
||||
G::LoadClass ( 'dynaFormField');
|
||||
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
$dbc = new DBConnection();
|
||||
$ses = new DBSession( $dbc);
|
||||
|
||||
$obj = new DynaFormField ($dbc);
|
||||
$t = new lime_test( 6, new lime_output_color() );
|
||||
|
||||
$t->diag('class DynaFormField' );
|
||||
$t->isa_ok( $obj , 'DynaFormField', 'class DynaFormField created');
|
||||
|
||||
//method Load
|
||||
$t->can_ok( $obj, 'Load', 'Load() is callable' );
|
||||
|
||||
// $result = $obj->Load ( $sUID);
|
||||
// $t->isa_ok( $result, 'NULL', 'call to method Load ');
|
||||
|
||||
|
||||
//method Delete
|
||||
$t->can_ok( $obj, 'Delete', 'Delete() is callable' );
|
||||
|
||||
// $result = $obj->Delete ( $uid);
|
||||
// $t->isa_ok( $result, 'NULL', 'call to method Delete ');
|
||||
|
||||
|
||||
//method Save
|
||||
$t->can_ok( $obj, 'Save', 'Save() is callable' );
|
||||
|
||||
// $result = $obj->Save ( $Fields, $labels, $options);
|
||||
// $t->isa_ok( $result, 'NULL', 'call to method Save ');
|
||||
|
||||
|
||||
//method isNew
|
||||
$t->can_ok( $obj, 'isNew', 'isNew() is callable' );
|
||||
|
||||
// $result = $obj->isNew ( );
|
||||
// $t->isa_ok( $result, 'NULL', 'call to method isNew ');
|
||||
|
||||
|
||||
//$t->fail( 'review all pendings methods in this class');
|
||||
$t->todo( "review all pendings methods in this class" );
|
||||
@@ -1,242 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* classESMTPTest.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
$unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
|
||||
require_once( $unitFilename );
|
||||
|
||||
require_once( PATH_THIRDPARTY . '/lime/lime.php');
|
||||
require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
|
||||
|
||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||
G::LoadSystem ( 'xmlform');
|
||||
G::LoadSystem ( 'xmlDocument');
|
||||
G::LoadSystem ( 'form');
|
||||
require_once( 'propel/Propel.php' );
|
||||
require_once ( "creole/Creole.php" );
|
||||
require_once ( PATH_CORE . "config/databases.php");
|
||||
|
||||
G::LoadClass ( 'smtp.rfc-821');
|
||||
|
||||
|
||||
//$obj = new ESMTP ($dbc);
|
||||
$t = new lime_test( 44, new lime_output_color() );
|
||||
|
||||
$className = ESMTP;
|
||||
$className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
|
||||
|
||||
$reflect = new ReflectionClass( $className );
|
||||
$method = array ( );
|
||||
$testItems = 0;
|
||||
|
||||
foreach ( $reflect->getMethods() as $reflectmethod ) {
|
||||
$params = '';
|
||||
foreach ( $reflectmethod->getParameters() as $key => $row ) {
|
||||
if ( $params != '' ) $params .= ', ';
|
||||
$params .= '$' . $row->name;
|
||||
}
|
||||
|
||||
$testItems++;
|
||||
$methods[ $reflectmethod->getName() ] = $params;
|
||||
}
|
||||
//To change the case only the first letter of each word, TIA
|
||||
$className = ucwords($className);
|
||||
$t->diag("class $className" );
|
||||
|
||||
//$t->isa_ok( $obj , $className, "class $className created");
|
||||
|
||||
$t->is( count($methods) , 21, "class $className have " . 21 . ' methods.' );
|
||||
|
||||
// Methods $t->is ( $aMethods[0],
|
||||
$aMethods = array_keys ( $methods );
|
||||
|
||||
//checking method 'ESMTP'
|
||||
$t->is ( $aMethods[0], 'ESMTP', 'ESMTP() is callable' );
|
||||
|
||||
//$result = $obj->ESMTP ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method ESMTP ');
|
||||
$t->todo( "call to method ESMTP using ");
|
||||
|
||||
|
||||
//checking method 'Connect'
|
||||
$t->is ( $aMethods[1], 'Connect', 'Connect() is callable' );
|
||||
|
||||
//$result = $obj->Connect ( $host, $port, $tval);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Connect ');
|
||||
$t->todo( "call to method Connect using $host, $port, $tval ");
|
||||
|
||||
|
||||
//checking method 'Authenticate'
|
||||
$t->is ( $aMethods[2], 'Authenticate', 'Authenticate() is callable' );
|
||||
|
||||
//$result = $obj->Authenticate ( $username, $password);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Authenticate ');
|
||||
$t->todo( "call to method Authenticate using $username, $password ");
|
||||
|
||||
|
||||
//checking method 'Connected'
|
||||
$t->is ( $aMethods[3], 'Connected', 'Connected() is callable' );
|
||||
|
||||
//$result = $obj->Connected ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Connected ');
|
||||
$t->todo( "call to method Connected using ");
|
||||
|
||||
|
||||
//checking method 'Close'
|
||||
$t->is ( $aMethods[4], 'Close', 'Close() is callable' );
|
||||
|
||||
//$result = $obj->Close ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Close ');
|
||||
$t->todo( "call to method Close using ");
|
||||
|
||||
|
||||
//checking method 'Data'
|
||||
$t->is ( $aMethods[5], 'Data', 'Data() is callable' );
|
||||
|
||||
//$result = $obj->Data ( $msg_data);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Data ');
|
||||
$t->todo( "call to method Data using $msg_data ");
|
||||
|
||||
|
||||
//checking method 'Expand'
|
||||
$t->is ( $aMethods[6], 'Expand', 'Expand() is callable' );
|
||||
|
||||
//$result = $obj->Expand ( $name);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Expand ');
|
||||
$t->todo( "call to method Expand using $name ");
|
||||
|
||||
|
||||
//checking method 'Hello'
|
||||
$t->is ( $aMethods[7], 'Hello', 'Hello() is callable' );
|
||||
|
||||
//$result = $obj->Hello ( $host);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Hello ');
|
||||
$t->todo( "call to method Hello using $host ");
|
||||
|
||||
|
||||
//checking method 'SendHello'
|
||||
$t->is ( $aMethods[8], 'SendHello', 'SendHello() is callable' );
|
||||
|
||||
//$result = $obj->SendHello ( $hello, $host);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method SendHello ');
|
||||
$t->todo( "call to method SendHello using $hello, $host ");
|
||||
|
||||
|
||||
//checking method 'Help'
|
||||
$t->is ( $aMethods[9], 'Help', 'Help() is callable' );
|
||||
|
||||
//$result = $obj->Help ( $keyword);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Help ');
|
||||
$t->todo( "call to method Help using $keyword ");
|
||||
|
||||
|
||||
//checking method 'Mail'
|
||||
$t->is ( $aMethods[10], 'Mail', 'Mail() is callable' );
|
||||
|
||||
//$result = $obj->Mail ( $from);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Mail ');
|
||||
$t->todo( "call to method Mail using $from ");
|
||||
|
||||
|
||||
//checking method 'Noop'
|
||||
$t->is ( $aMethods[11], 'Noop', 'Noop() is callable' );
|
||||
|
||||
//$result = $obj->Noop ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Noop ');
|
||||
$t->todo( "call to method Noop using ");
|
||||
|
||||
|
||||
//checking method 'Quit'
|
||||
$t->is ( $aMethods[12], 'Quit', 'Quit() is callable' );
|
||||
|
||||
//$result = $obj->Quit ( $close_on_error);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Quit ');
|
||||
$t->todo( "call to method Quit using $close_on_error ");
|
||||
|
||||
|
||||
//checking method 'Recipient'
|
||||
$t->is ( $aMethods[13], 'Recipient', 'Recipient() is callable' );
|
||||
|
||||
//$result = $obj->Recipient ( $to);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Recipient ');
|
||||
$t->todo( "call to method Recipient using $to ");
|
||||
|
||||
|
||||
//checking method 'Reset'
|
||||
$t->is ( $aMethods[14], 'Reset', 'Reset() is callable' );
|
||||
|
||||
//$result = $obj->Reset ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Reset ');
|
||||
$t->todo( "call to method Reset using ");
|
||||
|
||||
|
||||
//checking method 'Send'
|
||||
$t->is ( $aMethods[15], 'Send', 'Send() is callable' );
|
||||
|
||||
//$result = $obj->Send ( $from);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Send ');
|
||||
$t->todo( "call to method Send using $from ");
|
||||
|
||||
|
||||
//checking method 'SendAndMail'
|
||||
$t->is ( $aMethods[16], 'SendAndMail', 'SendAndMail() is callable' );
|
||||
|
||||
//$result = $obj->SendAndMail ( $from);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method SendAndMail ');
|
||||
$t->todo( "call to method SendAndMail using $from ");
|
||||
|
||||
|
||||
//checking method 'SendOrMail'
|
||||
$t->is ( $aMethods[17], 'SendOrMail', 'SendOrMail() is callable' );
|
||||
|
||||
//$result = $obj->SendOrMail ( $from);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method SendOrMail ');
|
||||
$t->todo( "call to method SendOrMail using $from ");
|
||||
|
||||
|
||||
//checking method 'Turn'
|
||||
$t->is ( $aMethods[18], 'Turn', 'Turn() is callable' );
|
||||
|
||||
//$result = $obj->Turn ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Turn ');
|
||||
$t->todo( "call to method Turn using ");
|
||||
|
||||
|
||||
//checking method 'Verify'
|
||||
$t->is ( $aMethods[19], 'Verify', 'Verify() is callable' );
|
||||
|
||||
//$result = $obj->Verify ( $name);
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method Verify ');
|
||||
$t->todo( "call to method Verify using $name ");
|
||||
|
||||
|
||||
//checking method 'get_lines'
|
||||
$t->is ( $aMethods[20], 'get_lines', 'get_lines() is callable' );
|
||||
|
||||
//$result = $obj->get_lines ( );
|
||||
//$t->isa_ok( $result, 'NULL', 'call to method get_lines ');
|
||||
$t->todo( "call to method get_lines using ");
|
||||
|
||||
|
||||
|
||||
$t->todo ( 'review all pendings methods in this class');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user