Merge remote branch 'upstream/master'

This commit is contained in:
Victor Saisa Lopez
2012-07-13 12:29:49 -04:00
6 changed files with 248 additions and 200 deletions

View File

@@ -1,4 +1,5 @@
<?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,248 +12,250 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.net.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
*/
*/
class classNETTest extends PHPUnit_Framework_TestCase
{
/**
* @var NET
*/
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
*/
protected function setUp()
{
$this->object = new NET();
$this->object = new NET('192.168.11.21');
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
*/
protected function tearDown()
{
}
/**
* This is the default method to test, if the class still having
* This is the default method to test, if the class still having
* the same number of methods.
*/
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('NET'); $this->assertTrue( count($methods) == 14);
$methods = get_class_methods('NET');
$this->assertTrue(count($methods) == 14);
}
/**
* @covers NET::__construct
* @todo Implement test__construct().
*/
* @covers NET::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$this->assertTrue(in_array('__construct', $methods), 'exists method __construct');
$r = new ReflectionMethod('NET', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::resolv
* @todo Implement testresolv().
*/
* @covers NET::resolv
* @todo Implement testresolv().
*/
public function testresolv()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('resolv', $methods ), 'exists method resolv' );
$this->assertTrue(in_array('resolv', $methods), 'exists method resolv');
$r = new ReflectionMethod('NET', 'resolv');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::scannPort
* @todo Implement testscannPort().
*/
* @covers NET::scannPort
* @todo Implement testscannPort().
*/
public function testscannPort()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('scannPort', $methods ), 'exists method scannPort' );
$this->assertTrue(in_array('scannPort', $methods), 'exists method scannPort');
$r = new ReflectionMethod('NET', 'scannPort');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pPort');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pPort');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::is_ipaddress
* @todo Implement testis_ipaddress().
*/
* @covers NET::is_ipaddress
* @todo Implement testis_ipaddress().
*/
public function testis_ipaddress()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('is_ipaddress', $methods ), 'exists method is_ipaddress' );
$this->assertTrue(in_array('is_ipaddress', $methods), 'exists method is_ipaddress');
$r = new ReflectionMethod('NET', 'is_ipaddress');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pHost');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pHost');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::ping
* @todo Implement testping().
*/
* @covers NET::ping
* @todo Implement testping().
*/
public function testping()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('ping', $methods ), 'exists method ping' );
$this->assertTrue(in_array('ping', $methods), 'exists method ping');
$r = new ReflectionMethod('NET', 'ping');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pTTL');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '3000');
}
$this->assertTrue($params[0]->getName() == 'pTTL');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == true);
$this->assertTrue($params[0]->getDefaultValue() == '3000');
}
/**
* @covers NET::loginDbServer
* @todo Implement testloginDbServer().
*/
* @covers NET::loginDbServer
* @todo Implement testloginDbServer().
*/
public function testloginDbServer()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('loginDbServer', $methods ), 'exists method loginDbServer' );
$this->assertTrue(in_array('loginDbServer', $methods), 'exists method loginDbServer');
$r = new ReflectionMethod('NET', 'loginDbServer');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pUser');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'pPasswd');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pUser');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue($params[1]->getName() == 'pPasswd');
$this->assertTrue($params[1]->isArray() == false);
$this->assertTrue($params[1]->isOptional() == false);
}
/**
* @covers NET::setDataBase
* @todo Implement testsetDataBase().
*/
* @covers NET::setDataBase
* @todo Implement testsetDataBase().
*/
public function testsetDataBase()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('setDataBase', $methods ), 'exists method setDataBase' );
$this->assertTrue(in_array('setDataBase', $methods), 'exists method setDataBase');
$r = new ReflectionMethod('NET', 'setDataBase');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDb');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'pPort');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
}
$this->assertTrue($params[0]->getName() == 'pDb');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue($params[1]->getName() == 'pPort');
$this->assertTrue($params[1]->isArray() == false);
$this->assertTrue($params[1]->isOptional() == true);
$this->assertTrue($params[1]->getDefaultValue() == '');
}
/**
* @covers NET::tryConnectServer
* @todo Implement testtryConnectServer().
*/
* @covers NET::tryConnectServer
* @todo Implement testtryConnectServer().
*/
public function testtryConnectServer()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('tryConnectServer', $methods ), 'exists method tryConnectServer' );
$this->assertTrue(in_array('tryConnectServer', $methods), 'exists method tryConnectServer');
$r = new ReflectionMethod('NET', 'tryConnectServer');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDbDriver');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pDbDriver');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::tryOpenDataBase
* @todo Implement testtryOpenDataBase().
*/
* @covers NET::tryOpenDataBase
* @todo Implement testtryOpenDataBase().
*/
public function testtryOpenDataBase()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('tryOpenDataBase', $methods ), 'exists method tryOpenDataBase' );
$this->assertTrue(in_array('tryOpenDataBase', $methods), 'exists method tryOpenDataBase');
$r = new ReflectionMethod('NET', 'tryOpenDataBase');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pDbDriver');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pDbDriver');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::getDbServerVersion
* @todo Implement testgetDbServerVersion().
*/
* @covers NET::getDbServerVersion
* @todo Implement testgetDbServerVersion().
*/
public function testgetDbServerVersion()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getDbServerVersion', $methods ), 'exists method getDbServerVersion' );
$this->assertTrue(in_array('getDbServerVersion', $methods), 'exists method getDbServerVersion');
$r = new ReflectionMethod('NET', 'getDbServerVersion');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'driver');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'driver');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::dbName
* @todo Implement testdbName().
*/
* @covers NET::dbName
* @todo Implement testdbName().
*/
public function testdbName()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('dbName', $methods ), 'exists method dbName' );
$this->assertTrue(in_array('dbName', $methods), 'exists method dbName');
$r = new ReflectionMethod('NET', 'dbName');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pAdapter');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
$this->assertTrue($params[0]->getName() == 'pAdapter');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
}
/**
* @covers NET::showMsg
* @todo Implement testshowMsg().
*/
* @covers NET::showMsg
* @todo Implement testshowMsg().
*/
public function testshowMsg()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('showMsg', $methods ), 'exists method showMsg' );
$this->assertTrue(in_array('showMsg', $methods), 'exists method showMsg');
$r = new ReflectionMethod('NET', 'showMsg');
$params = $r->getParameters();
}
}
/**
* @covers NET::getErrno
* @todo Implement testgetErrno().
*/
* @covers NET::getErrno
* @todo Implement testgetErrno().
*/
public function testgetErrno()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getErrno', $methods ), 'exists method getErrno' );
$this->assertTrue(in_array('getErrno', $methods), 'exists method getErrno');
$r = new ReflectionMethod('NET', 'getErrno');
$params = $r->getParameters();
}
}
/**
* @covers NET::getErrmsg
* @todo Implement testgetErrmsg().
*/
* @covers NET::getErrmsg
* @todo Implement testgetErrmsg().
*/
public function testgetErrmsg()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getErrmsg', $methods ), 'exists method getErrmsg' );
$this->assertTrue(in_array('getErrmsg', $methods), 'exists method getErrmsg');
$r = new ReflectionMethod('NET', 'getErrmsg');
$params = $r->getParameters();
}
}
}
}

View File

@@ -43,7 +43,8 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('PmTable'); $this->assertTrue( count($methods) == 26);
$methods = get_class_methods('PmTable');
$this->assertTrue( count($methods) == 26);
}
/**
@@ -60,7 +61,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
}
/**
* @covers PmTable::setColumns
@@ -75,7 +76,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'columns');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}
/**
* @covers PmTable::setDataSource
@@ -90,7 +91,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'dbsUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}
/**
* @covers PmTable::resolveDbSource
@@ -105,7 +106,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'dbsUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}
/**
* @covers PmTable::getDataSource
@@ -117,7 +118,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('getDataSource', $methods ), 'exists method getDataSource' );
$r = new ReflectionMethod('PmTable', 'getDataSource');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::getDbConfig
@@ -129,7 +130,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('getDbConfig', $methods ), 'exists method getDbConfig' );
$r = new ReflectionMethod('PmTable', 'getDbConfig');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::setAlterTable
@@ -144,7 +145,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'value');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}
/**
* @covers PmTable::build
@@ -156,7 +157,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('build', $methods ), 'exists method build' );
$r = new ReflectionMethod('PmTable', 'build');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::buildModelFor
@@ -174,7 +175,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[1]->getName() == 'tablesList');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
}
/**
* @covers PmTable::prepare
@@ -190,7 +191,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '1');
}
}
/**
* @covers PmTable::loadSchema
@@ -202,7 +203,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('loadSchema', $methods ), 'exists method loadSchema' );
$r = new ReflectionMethod('PmTable', 'loadSchema');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::buildSchema
@@ -214,7 +215,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('buildSchema', $methods ), 'exists method buildSchema' );
$r = new ReflectionMethod('PmTable', 'buildSchema');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::remove
@@ -226,7 +227,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('remove', $methods ), 'exists method remove' );
$r = new ReflectionMethod('PmTable', 'remove');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::removeFromSchema
@@ -238,7 +239,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('removeFromSchema', $methods ), 'exists method removeFromSchema' );
$r = new ReflectionMethod('PmTable', 'removeFromSchema');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::removeModelFiles
@@ -250,7 +251,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('removeModelFiles', $methods ), 'exists method removeModelFiles' );
$r = new ReflectionMethod('PmTable', 'removeModelFiles');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::dropTable
@@ -266,7 +267,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
}
/**
* @covers PmTable::saveSchema
@@ -278,7 +279,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('saveSchema', $methods ), 'exists method saveSchema' );
$r = new ReflectionMethod('PmTable', 'saveSchema');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::preparePropelIniFile
@@ -290,7 +291,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('preparePropelIniFile', $methods ), 'exists method preparePropelIniFile' );
$r = new ReflectionMethod('PmTable', 'preparePropelIniFile');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::upgradeDatabase
@@ -302,7 +303,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('upgradeDatabase', $methods ), 'exists method upgradeDatabase' );
$r = new ReflectionMethod('PmTable', 'upgradeDatabase');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::upgradeDatabaseFor
@@ -320,8 +321,8 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[1]->getName() == 'tablesList');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'Array');
}
$this->assertTrue( $params[1]->getDefaultValue() == array());
}
/**
* @covers PmTable::hasAutoIncrementPKey
@@ -333,7 +334,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('hasAutoIncrementPKey', $methods ), 'exists method hasAutoIncrementPKey' );
$r = new ReflectionMethod('PmTable', 'hasAutoIncrementPKey');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::getPropelSupportedColumnTypes
@@ -342,10 +343,11 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
public function testgetPropelSupportedColumnTypes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getPropelSupportedColumnTypes', $methods ), 'exists method getPropelSupportedColumnTypes' );
$this->assertTrue( in_array('getPropelSupportedColumnTypes', $methods ),
'exists method getPropelSupportedColumnTypes' );
$r = new ReflectionMethod('PmTable', 'getPropelSupportedColumnTypes');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::toCamelCase
@@ -360,7 +362,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->getName() == 'name');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}
/**
* @covers PmTable::phingbuildModel
@@ -372,7 +374,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('phingbuildModel', $methods ), 'exists method phingbuildModel' );
$r = new ReflectionMethod('PmTable', 'phingbuildModel');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::phingbuildSql
@@ -384,7 +386,7 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( in_array('phingbuildSql', $methods ), 'exists method phingbuildSql' );
$r = new ReflectionMethod('PmTable', 'phingbuildSql');
$params = $r->getParameters();
}
}
/**
* @covers PmTable::callPhing
@@ -406,11 +408,11 @@ class classPmTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[2]->getName() == 'options');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'Array');
$this->assertTrue( $params[2]->getDefaultValue() == array());
$this->assertTrue( $params[3]->getName() == 'verbose');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '1');
}
}
}
}

View File

@@ -1,4 +1,5 @@
<?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,69 +12,72 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.plugin.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
*/
*/
class classcaseSchedulerPluginTest extends PHPUnit_Framework_TestCase
{
/**
* @var caseSchedulerPlugin
*/
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
*/
protected function setUp()
{
$this->object = new caseSchedulerPlugin();
$this->object = new caseSchedulerPlugin('sNamespace', 'sActionId', 'sActionForm',
'sActionSave', 'sActionExecute', 'sActionGetFields');
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
*/
protected function tearDown()
{
}
/**
* This is the default method to test, if the class still having
* This is the default method to test, if the class still having
* the same number of methods.
*/
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('caseSchedulerPlugin'); $this->assertTrue( count($methods) == 1);
$methods = get_class_methods('caseSchedulerPlugin');
$this->assertTrue(count($methods) == 1);
}
/**
* @covers caseSchedulerPlugin::__construct
* @todo Implement test__construct().
*/
* @covers caseSchedulerPlugin::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$this->assertTrue(in_array('__construct', $methods), 'exists method __construct');
$r = new ReflectionMethod('caseSchedulerPlugin', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sNamespace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'sActionId');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'sActionForm');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'sActionSave');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'sActionExecute');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'sActionGetFields');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
}
}
$this->assertTrue($params[0]->getName() == 'sNamespace');
$this->assertTrue($params[0]->isArray() == false);
$this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue($params[1]->getName() == 'sActionId');
$this->assertTrue($params[1]->isArray() == false);
$this->assertTrue($params[1]->isOptional() == false);
$this->assertTrue($params[2]->getName() == 'sActionForm');
$this->assertTrue($params[2]->isArray() == false);
$this->assertTrue($params[2]->isOptional() == false);
$this->assertTrue($params[3]->getName() == 'sActionSave');
$this->assertTrue($params[3]->isArray() == false);
$this->assertTrue($params[3]->isOptional() == false);
$this->assertTrue($params[4]->getName() == 'sActionExecute');
$this->assertTrue($params[4]->isArray() == false);
$this->assertTrue($params[4]->isOptional() == false);
$this->assertTrue($params[5]->getName() == 'sActionGetFields');
$this->assertTrue($params[5]->isArray() == false);
$this->assertTrue($params[5]->isOptional() == false);
}
}

View File

@@ -26,7 +26,8 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new folderData();
$this->object = new folderData('$sProcessUid', '$sProcessTitle', '$sApplicationUid',
'$sApplicationTitle', '$sUserUid', '$sUserLogin', '$sUserFullName');
}
/**
@@ -43,7 +44,8 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('folderData'); $this->assertTrue( count($methods) == 1);
$methods = get_class_methods('folderData');
$this->assertTrue( count($methods) == 1);
}
/**
@@ -79,6 +81,6 @@ class classfolderDataTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[6]->isArray() == false);
$this->assertTrue( $params[6]->isOptional () == true);
$this->assertTrue( $params[6]->getDefaultValue() == '');
}
}
}
}

View File

@@ -66,7 +66,7 @@ class InvalidIndexSearchTextException extends Exception
* @author Herbert Saal Gutierrez
*
* @category Colosa
* @copyright Copyright (c) 2005-2011 Colosa Inc. (http://www.colosa.com)
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
*/
class ApplicationWithoutDelegationRecordsException extends Exception
{
@@ -85,6 +85,31 @@ class ApplicationWithoutDelegationRecordsException extends Exception
}
}
/**
* Application APP_DATA could not be unserialized exception
*
* @author Herbert Saal Gutierrez
*
* @category Colosa
* @copyright Copyright (c) 2005-2012 Colosa Inc. (http://www.colosa.com)
*/
class ApplicationAPP_DATAUnserializeException extends Exception
{
// Redefine the exception so message isn't optional
public function __construct($message, $code = 0)
{
// some code
// make sure everything is assigned properly
parent::__construct ($message, $code);
}
// custom string representation of object
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
}
/**
* Implementation to display application data in the PMOS2 grids using Solr
* search service
@@ -1015,11 +1040,23 @@ class AppSolr
$unassignedUsers = $result [11];
$unassignedGroups = $result [12];
// create document
$xmlDoc .= $this->buildSearchIndexDocumentPMOS2 ($documentInformation, $dynaformFieldTypes,
$lastUpdateDate, $maxPriority, $assignedUsers, $assignedUsersRead, $assignedUsersUnread,
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
$unassignedUsers, $unassignedGroups);
try {
// create document
$xmlDoc .= $this->buildSearchIndexDocumentPMOS2 ($documentInformation, $dynaformFieldTypes,
$lastUpdateDate, $maxPriority, $assignedUsers, $assignedUsersRead, $assignedUsersUnread,
$draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser,
$unassignedUsers, $unassignedGroups);
}
catch ( ApplicationAPP_DATAUnserializeException $e ) {
// exception trying to get application information
//print $e->message +" \n";
//$fh = fopen("./UnserializeError_APP_DATA".".txt", 'a') or die("can't open file");
//fwrite($fh, $e->message . "\n");
//fclose($fh);
// skip and continue with the next application
continue;
}
}
@@ -1288,7 +1325,7 @@ class AppSolr
if (! $UnSerializedCaseData) {
// error unserializing
throw new Exception ("Unserialize APP_DATA error. APP_UID: " . $documentData ['APP_UID']);
throw new ApplicationAPP_DATAUnserializeException ("Could not unserialize APP_DATA of APP_UID: " . $documentData ['APP_UID']);
}
else {
foreach ($UnSerializedCaseData as $k => $value) {
@@ -1390,7 +1427,7 @@ class AppSolr
}
}
} // foreach unserialized data
}
}// else unserialize APP_DATA
} // empty APP_DATA
$writer->endElement (); // end /doc

View File

@@ -22,7 +22,7 @@ try {
$userUid = (isset ( $_SESSION ['USER_LOGGED'] ) && $_SESSION ['USER_LOGGED'] != '') ? $_SESSION ['USER_LOGGED'] : null;
if ((($solrConf = System::solrEnv()) !== false) && $action != 'paused') {
if (($action == 'todo' || $action == 'draft' || $action == 'sent' || $action == 'selfservice' || $action == 'unassigned' || $action == 'search') && (($solrConf = System::solrEnv()) !== false)) {
G::LoadClass ( 'AppSolr' );
$ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']);