fixing testunits for gulliver classes

This commit is contained in:
Fernando
2012-07-13 06:27:36 -04:00
parent 259263bcc8
commit 8700af7df4
48 changed files with 516 additions and 419 deletions

View File

@@ -15,9 +15,11 @@
<testsuite name="automated">
<directory>./tests/automated/</directory>
</testsuite>
<!--
<testsuite name="unit">
<directory>./tests/unit/</directory>
</testsuite>
-->
</testsuites>
<!-- <filter>

View File

@@ -26,7 +26,9 @@ class classXmlForm_FieldTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_ButtonTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Button();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Button($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CaptionCurrencyTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_CaptionCurrency();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_CaptionCurrency($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CaptionPercentageTest extends PHPUnit_Framework_TestCas
*/
protected function setUp()
{
$this->object = new XmlForm_Field_CaptionPercentage();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_CaptionPercentage($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CaptionTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Caption();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Caption($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CheckGroupTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_CheckGroup();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_CheckGroup($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CheckGroupViewTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_CheckGroupView();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_CheckGroupView($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_Checkbox2Test extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Checkbox2();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Checkbox2($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CheckboxTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Checkbox();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Checkbox($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CheckboxptTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Checkboxpt();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Checkboxpt($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_CurrencyTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Currency();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Currency($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_DVEditorTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_DVEditor();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_DVEditor($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_Date2Test extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Date2();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Date2($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_Date5Test extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Date5();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Date5($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_DateTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Date();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Date($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_DateViewTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_DateView();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_DateView($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_DropdownTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Dropdown();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Dropdown($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_DropdownptTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Dropdownpt();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Dropdownpt($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_FastSearchTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_FastSearch();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_FastSearch($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_FileTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_File();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_File($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_GridTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Grid();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Grid($fieldNode,'param', 'param');
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_HTMLTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_HTML();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_HTML($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_HiddenTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Hidden();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Hidden($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_ImageTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Image();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Image($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_JavaScriptTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_JavaScript();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_JavaScript($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_LabelTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Label();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Label($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_LinkTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Link();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Link($fieldNode);
}
/**
@@ -79,7 +81,7 @@ class classXmlForm_Field_LinkTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'values');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == 'Array');
$this->assertTrue( $params[0]->getDefaultValue() == Array());
$this->assertTrue( $params[1]->getName() == 'owner');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_ListboxTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Listbox();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Listbox($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_PasswordTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Password();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Password($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_PercentageTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Percentage();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Percentage($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_PrintTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Print();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Print($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_RadioGroupTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_RadioGroup();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_RadioGroup($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_RadioGroupViewTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_RadioGroupView();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_RadioGroupView($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_ResetTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Reset();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Reset($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_SimpleTextTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_SimpleText();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_SimpleText($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_SubmitTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Submit();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Submit($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_SubtitleTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Subtitle();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Subtitle($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_SuggestTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Suggest();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Suggest($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_TextTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Text();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Text($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_TextareaTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Textarea();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Textarea($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_TitleTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Title();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Title($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_XmlMenuTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_XmlMenu();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_XmlMenu($fieldNode,'lang','home','owner');
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_XmlformTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_Xmlform();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_Xmlform($fieldNode,'lang','home','owner');
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_YesNoTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_YesNo();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_YesNo($fieldNode);
}
/**

View File

@@ -26,7 +26,9 @@ class classXmlForm_Field_cellMarkTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_cellMark();
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field_cellMark($fieldNode);
}
/**

View File

@@ -161,7 +161,7 @@ class classtestToolsTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[1]->getName() == 'ExternalVariables');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'Array');
$this->assertTrue( $params[1]->getDefaultValue() == Array());
}
/**

View File

@@ -66,24 +66,27 @@ G::LoadClass('pmScript');
* @package workflow.engine.classes
*/
class Cases {
private $appSolr = null;
class Cases
{
private $appSolr = null;
function __construct(){
//get Solr initialization variables
if(($solrConf = System::solrEnv()) !== false){
G::LoadClass('AppSolr');
$this->appSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
public function __construct()
{
//get Solr initialization variables
if (($solrConf = System::solrEnv()) !== false) {
G::LoadClass('AppSolr');
$this->appSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);
}
}
}
/*
* Ask if an user can start a case
* @param string $sUIDUser
* @return boolean
*/
/*
* Ask if an user can start a case
* @param string $sUIDUser
* @return boolean
*/
function canStartCase($sUIDUser = '') {
public function canStartCase($sUIDUser = '')
{
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn('COUNT(*)');
@@ -97,8 +100,9 @@ class Cases {
$rs->next();
$row = $rs->getRow();
$count = $row[0];
if ($count > 0)
if ($count > 0) {
return true;
}
//check groups
G::LoadClass('groups');
@@ -897,7 +901,7 @@ class Cases {
//now update the priority in appdelegation table, using the defined variable in task
if (trim($DEL_INDEX) != '' && trim($TAS_UID) != '') {
//optimized code to avoid load task content row.
//optimized code to avoid load task content row.
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(TaskPeer::TAS_PRIORITY_VARIABLE);
@@ -1587,7 +1591,7 @@ class Cases {
$c2 = new Criteria('workflow');
$c2->add(AppThreadPeer::DEL_INDEX, $iNewDelIndex );
BasePeer::doUpdate($c1, $c2,$con);
/*
/*
$appThread = new AppThread();
$aData = array();
$aData['APP_UID'] = $sAppUid;
@@ -5671,3 +5675,4 @@ class Cases {
return $response;
}
}