PageRenderTime 24ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/workflow/engine/test/unit/processmaker/classXmlForm_Field_TextPMTest.php

https://bitbucket.org/ferOnti/processmaker
PHP | 210 lines | 73 code | 73 blank | 64 comment | 2 complexity | 6674168191a5a69a2e648c3159d52e9a MD5 | raw file
  1. <?php
  2. $unitFilename = $_SERVER['PWD'] . '/test/bootstrap/unit.php' ;
  3. require_once( $unitFilename );
  4. require_once( PATH_THIRDPARTY . '/lime/lime.php');
  5. require_once( PATH_THIRDPARTY.'lime/yaml.class.php');
  6. G::LoadThirdParty('smarty/libs','Smarty.class');
  7. G::LoadSystem ( 'xmlform');
  8. G::LoadSystem ( 'xmlDocument');
  9. G::LoadSystem ( 'form');
  10. require_once( 'propel/Propel.php' );
  11. require_once ( "creole/Creole.php" );
  12. require_once ( PATH_CORE . "config/databases.php");
  13. G::LoadClass ( 'xmlfield_InputPM');
  14. //$obj = new XmlForm_Field_TextPM ($dbc);
  15. $t = new lime_test( 42, new lime_output_color() );
  16. $className = XmlForm_Field_TextPM;
  17. $className = strtolower ( substr ($className, 0,1) ) . substr ($className, 1 );
  18. $reflect = new ReflectionClass( $className );
  19. $method = array ( );
  20. $testItems = 0;
  21. foreach ( $reflect->getMethods() as $reflectmethod ) {
  22. $params = '';
  23. foreach ( $reflectmethod->getParameters() as $key => $row ) {
  24. if ( $params != '' ) $params .= ', ';
  25. $params .= '$' . $row->name;
  26. }
  27. $testItems++;
  28. $methods[ $reflectmethod->getName() ] = $params;
  29. }
  30. //To change the case only the first letter of each word, TIA
  31. $className = ucwords($className);
  32. $t->diag("class $className" );
  33. //$t->isa_ok( $obj , $className, "class $className created");
  34. $t->is( count($methods) , 20, "class $className have " . 20 . ' methods.' );
  35. //Methods
  36. $aMethods = array_keys ( $methods );
  37. //checking method 'render'
  38. $t->is ( $aMethods[0], 'render', 'render() is callable' );
  39. //$result = $obj->render ( $value, $owner);
  40. //$t->isa_ok( $result, 'NULL', 'call to method render ');
  41. $t->todo( "call to method render using $value, $owner ");
  42. //checking method 'renderGrid'
  43. $t->is ( $aMethods[1], 'renderGrid', 'renderGrid() is callable' );
  44. //$result = $obj->renderGrid ( $values, $owner);
  45. //$t->isa_ok( $result, 'NULL', 'call to method renderGrid ');
  46. $t->todo( "call to method renderGrid using $values, $owner ");
  47. //checking method 'attachEvents'
  48. $t->is ( $aMethods[2], 'attachEvents', 'attachEvents() is callable' );
  49. //$result = $obj->attachEvents ( $element);
  50. //$t->isa_ok( $result, 'NULL', 'call to method attachEvents ');
  51. $t->todo( "call to method attachEvents using $element ");
  52. //checking method 'XmlForm_Field'
  53. $t->is ( $aMethods[3], 'XmlForm_Field', 'XmlForm_Field() is callable' );
  54. //$result = $obj->XmlForm_Field ( $xmlNode, $lang, $home, $owner);
  55. //$t->isa_ok( $result, 'NULL', 'call to method XmlForm_Field ');
  56. $t->todo( "call to method XmlForm_Field using $xmlNode, $lang, $home, $owner ");
  57. //checking method 'validateValue'
  58. $t->is ( $aMethods[4], 'validateValue', 'validateValue() is callable' );
  59. //$result = $obj->validateValue ( $value);
  60. //$t->isa_ok( $result, 'NULL', 'call to method validateValue ');
  61. $t->todo( "call to method validateValue using $value ");
  62. //checking method 'executeXmlDB'
  63. $t->is ( $aMethods[5], 'executeXmlDB', 'executeXmlDB() is callable' );
  64. //$result = $obj->executeXmlDB ( $owner, $row);
  65. //$t->isa_ok( $result, 'NULL', 'call to method executeXmlDB ');
  66. $t->todo( "call to method executeXmlDB using $owner, $row ");
  67. //checking method 'executePropel'
  68. $t->is ( $aMethods[6], 'executePropel', 'executePropel() is callable' );
  69. //$result = $obj->executePropel ( $owner, $row);
  70. //$t->isa_ok( $result, 'NULL', 'call to method executePropel ');
  71. $t->todo( "call to method executePropel using $owner, $row ");
  72. //checking method 'executeSQL'
  73. $t->is ( $aMethods[7], 'executeSQL', 'executeSQL() is callable' );
  74. //$result = $obj->executeSQL ( $owner, $row);
  75. //$t->isa_ok( $result, 'NULL', 'call to method executeSQL ');
  76. $t->todo( "call to method executeSQL using $owner, $row ");
  77. //checking method 'htmlentities'
  78. $t->is ( $aMethods[8], 'htmlentities', 'htmlentities() is callable' );
  79. //$result = $obj->htmlentities ( $value, $flags, $encoding);
  80. //$t->isa_ok( $result, 'NULL', 'call to method htmlentities ');
  81. $t->todo( "call to method htmlentities using $value, $flags, $encoding ");
  82. //checking method 'renderTable'
  83. $t->is ( $aMethods[9], 'renderTable', 'renderTable() is callable' );
  84. //$result = $obj->renderTable ( $values, $owner, $onlyValue);
  85. //$t->isa_ok( $result, 'NULL', 'call to method renderTable ');
  86. $t->todo( "call to method renderTable using $values, $owner, $onlyValue ");
  87. //checking method 'dependentOf'
  88. $t->is ( $aMethods[10], 'dependentOf', 'dependentOf() is callable' );
  89. //$result = $obj->dependentOf ( );
  90. //$t->isa_ok( $result, 'NULL', 'call to method dependentOf ');
  91. $t->todo( "call to method dependentOf using ");
  92. //checking method 'mask'
  93. $t->is ( $aMethods[11], 'mask', 'mask() is callable' );
  94. //$result = $obj->mask ( $format, $value);
  95. //$t->isa_ok( $result, 'NULL', 'call to method mask ');
  96. $t->todo( "call to method mask using $format, $value ");
  97. //checking method 'getAttributes'
  98. $t->is ( $aMethods[12], 'getAttributes', 'getAttributes() is callable' );
  99. //$result = $obj->getAttributes ( );
  100. //$t->isa_ok( $result, 'NULL', 'call to method getAttributes ');
  101. $t->todo( "call to method getAttributes using ");
  102. //checking method 'getEvents'
  103. $t->is ( $aMethods[13], 'getEvents', 'getEvents() is callable' );
  104. //$result = $obj->getEvents ( );
  105. //$t->isa_ok( $result, 'NULL', 'call to method getEvents ');
  106. $t->todo( "call to method getEvents using ");
  107. //checking method 'createXmlNode'
  108. $t->is ( $aMethods[14], 'createXmlNode', 'createXmlNode() is callable' );
  109. //$result = $obj->createXmlNode ( $includeDefaultValues);
  110. //$t->isa_ok( $result, 'NULL', 'call to method createXmlNode ');
  111. $t->todo( "call to method createXmlNode using $includeDefaultValues ");
  112. //checking method 'updateXmlNode'
  113. $t->is ( $aMethods[15], 'updateXmlNode', 'updateXmlNode() is callable' );
  114. //$result = $obj->updateXmlNode ( $node, $includeDefaultValues);
  115. //$t->isa_ok( $result, 'NULL', 'call to method updateXmlNode ');
  116. $t->todo( "call to method updateXmlNode using $node, $includeDefaultValues ");
  117. //checking method 'getXmlAttributes'
  118. $t->is ( $aMethods[16], 'getXmlAttributes', 'getXmlAttributes() is callable' );
  119. //$result = $obj->getXmlAttributes ( $includeDefaultValues);
  120. //$t->isa_ok( $result, 'NULL', 'call to method getXmlAttributes ');
  121. $t->todo( "call to method getXmlAttributes using $includeDefaultValues ");
  122. //checking method 'maskValue'
  123. $t->is ( $aMethods[17], 'maskValue', 'maskValue() is callable' );
  124. //$result = $obj->maskValue ( $value, $owner);
  125. //$t->isa_ok( $result, 'NULL', 'call to method maskValue ');
  126. $t->todo( "call to method maskValue using $value, $owner ");
  127. //checking method 'cloneObject'
  128. $t->is ( $aMethods[18], 'cloneObject', 'cloneObject() is callable' );
  129. //$result = $obj->cloneObject ( );
  130. //$t->isa_ok( $result, 'NULL', 'call to method cloneObject ');
  131. $t->todo( "call to method cloneObject using ");
  132. //checking method 'getPMTableValue'
  133. $t->is ( $aMethods[19], 'getPMTableValue', 'getPMTableValue() is callable' );
  134. //$result = $obj->getPMTableValue ( $oOwner);
  135. //$t->isa_ok( $result, 'NULL', 'call to method getPMTableValue ');
  136. $t->todo( "call to method getPMTableValue using $oOwner ");
  137. $t->todo ( 'review all pendings methods in this class');