adding phpunit, and updating the phpunit.xml

This commit is contained in:
Fernando Ontiveros
2012-07-12 20:42:56 -04:00
parent dd88abc53b
commit dcc1754ecf
9 changed files with 1541 additions and 91 deletions

View File

@@ -12,7 +12,10 @@
bootstrap="tests/bootstrap.php" bootstrap="tests/bootstrap.php"
> >
<testsuites> <testsuites>
<testsuite name="ProcessMaker Test Suite"> <testsuite name="automated">
<directory>./tests/automated/</directory>
</testsuite>
<testsuite name="unit">
<directory>./tests/unit/</directory> <directory>./tests/unit/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
@@ -27,9 +30,11 @@
</exclude> </exclude>
</whitelist> </whitelist>
</filter> --> </filter> -->
<php> <php>
<var name="SYS_SYS" value="os" /> <var name="SYS_SYS" value="os" />
<var name="SYS_LANG" value="en" />
<var name="SYS_SKIN" value="classic" />
</php> </php>
<logging> <logging>
@@ -38,5 +43,5 @@
lowUpperBound="10" highLowerBound="20"/> lowUpperBound="10" highLowerBound="20"/>
<log type="coverage-clover" target="build/logs/clover.xml"/> <log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging> </logging>
</phpunit> </phpunit>

View File

@@ -0,0 +1,606 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.AppSolr.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:32.
*/
class classAppSolrTest extends PHPUnit_Framework_TestCase
{
/**
* @var AppSolr
*/
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 AppSolr();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 25);
}
/**
* @covers AppSolr::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('AppSolr', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'SolrEnabled');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'SolrHost');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'SolrInstance');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::isSolrEnabled
* @todo Implement testisSolrEnabled().
*/
public function testisSolrEnabled()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('isSolrEnabled', $methods ), 'exists method isSolrEnabled' );
$r = new ReflectionMethod('AppSolr', 'isSolrEnabled');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getAppGridData
* @todo Implement testgetAppGridData().
*/
public function testgetAppGridData()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getAppGridData', $methods ), 'exists method getAppGridData' );
$r = new ReflectionMethod('AppSolr', 'getAppGridData');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'userUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'start');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->assertTrue( $params[2]->getName() == 'limit');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
$this->assertTrue( $params[3]->getName() == 'action');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
$this->assertTrue( $params[4]->getName() == 'filter');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == true);
$this->assertTrue( $params[4]->getDefaultValue() == '');
$this->assertTrue( $params[5]->getName() == 'search');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == true);
$this->assertTrue( $params[5]->getDefaultValue() == '');
$this->assertTrue( $params[6]->getName() == 'process');
$this->assertTrue( $params[6]->isArray() == false);
$this->assertTrue( $params[6]->isOptional () == true);
$this->assertTrue( $params[6]->getDefaultValue() == '');
$this->assertTrue( $params[7]->getName() == 'user');
$this->assertTrue( $params[7]->isArray() == false);
$this->assertTrue( $params[7]->isOptional () == true);
$this->assertTrue( $params[7]->getDefaultValue() == '');
$this->assertTrue( $params[8]->getName() == 'status');
$this->assertTrue( $params[8]->isArray() == false);
$this->assertTrue( $params[8]->isOptional () == true);
$this->assertTrue( $params[8]->getDefaultValue() == '');
$this->assertTrue( $params[9]->getName() == 'type');
$this->assertTrue( $params[9]->isArray() == false);
$this->assertTrue( $params[9]->isOptional () == true);
$this->assertTrue( $params[9]->getDefaultValue() == '');
$this->assertTrue( $params[10]->getName() == 'dateFrom');
$this->assertTrue( $params[10]->isArray() == false);
$this->assertTrue( $params[10]->isOptional () == true);
$this->assertTrue( $params[10]->getDefaultValue() == '');
$this->assertTrue( $params[11]->getName() == 'dateTo');
$this->assertTrue( $params[11]->isArray() == false);
$this->assertTrue( $params[11]->isOptional () == true);
$this->assertTrue( $params[11]->getDefaultValue() == '');
$this->assertTrue( $params[12]->getName() == 'callback');
$this->assertTrue( $params[12]->isArray() == false);
$this->assertTrue( $params[12]->isOptional () == true);
$this->assertTrue( $params[12]->getDefaultValue() == '');
$this->assertTrue( $params[13]->getName() == 'dir');
$this->assertTrue( $params[13]->isArray() == false);
$this->assertTrue( $params[13]->isOptional () == true);
$this->assertTrue( $params[13]->getDefaultValue() == '');
$this->assertTrue( $params[14]->getName() == 'sort');
$this->assertTrue( $params[14]->isArray() == false);
$this->assertTrue( $params[14]->isOptional () == true);
$this->assertTrue( $params[14]->getDefaultValue() == 'APP_CACHE_VIEW.APP_NUMBER');
$this->assertTrue( $params[15]->getName() == 'doCount');
$this->assertTrue( $params[15]->isArray() == false);
$this->assertTrue( $params[15]->isOptional () == true);
$this->assertTrue( $params[15]->getDefaultValue() == '');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getCasesCount
* @todo Implement testgetCasesCount().
*/
public function testgetCasesCount()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getCasesCount', $methods ), 'exists method getCasesCount' );
$r = new ReflectionMethod('AppSolr', 'getCasesCount');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'userUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getUserGroups
* @todo Implement testgetUserGroups().
*/
public function testgetUserGroups()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getUserGroups', $methods ), 'exists method getUserGroups' );
$r = new ReflectionMethod('AppSolr', 'getUserGroups');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'usrUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getAppDelegationData
* @todo Implement testgetAppDelegationData().
*/
public function testgetAppDelegationData()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getAppDelegationData', $methods ), 'exists method getAppDelegationData' );
$r = new ReflectionMethod('AppSolr', 'getAppDelegationData');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'appUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'delIndex');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getSearchText
* @todo Implement testgetSearchText().
*/
public function testgetSearchText()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getSearchText', $methods ), 'exists method getSearchText' );
$r = new ReflectionMethod('AppSolr', 'getSearchText');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'plainSearchText');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getApplicationDelegationsIndex
* @todo Implement testgetApplicationDelegationsIndex().
*/
public function testgetApplicationDelegationsIndex()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getApplicationDelegationsIndex', $methods ), 'exists method getApplicationDelegationsIndex' );
$r = new ReflectionMethod('AppSolr', 'getApplicationDelegationsIndex');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'appUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::updateApplicationSearchIndex
* @todo Implement testupdateApplicationSearchIndex().
*/
public function testupdateApplicationSearchIndex()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('updateApplicationSearchIndex', $methods ), 'exists method updateApplicationSearchIndex' );
$r = new ReflectionMethod('AppSolr', 'updateApplicationSearchIndex');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'aaAPPUIDs');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::deleteApplicationSearchIndex
* @todo Implement testdeleteApplicationSearchIndex().
*/
public function testdeleteApplicationSearchIndex()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('deleteApplicationSearchIndex', $methods ), 'exists method deleteApplicationSearchIndex' );
$r = new ReflectionMethod('AppSolr', 'deleteApplicationSearchIndex');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'appUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::createSolrXMLDocument
* @todo Implement testcreateSolrXMLDocument().
*/
public function testcreateSolrXMLDocument()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSolrXMLDocument', $methods ), 'exists method createSolrXMLDocument' );
$r = new ReflectionMethod('AppSolr', 'createSolrXMLDocument');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'aaAPPUIDs');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::buildSearchIndexDocumentPMOS2
* @todo Implement testbuildSearchIndexDocumentPMOS2().
*/
public function testbuildSearchIndexDocumentPMOS2()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('buildSearchIndexDocumentPMOS2', $methods ), 'exists method buildSearchIndexDocumentPMOS2' );
$r = new ReflectionMethod('AppSolr', 'buildSearchIndexDocumentPMOS2');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'documentData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'dynaformFieldTypes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'lastUpdateDate');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'maxPriority');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'assignedUsers');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'assignedUsersRead');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
$this->assertTrue( $params[6]->getName() == 'assignedUsersUnread');
$this->assertTrue( $params[6]->isArray() == false);
$this->assertTrue( $params[6]->isOptional () == false);
$this->assertTrue( $params[7]->getName() == 'draftUser');
$this->assertTrue( $params[7]->isArray() == false);
$this->assertTrue( $params[7]->isOptional () == false);
$this->assertTrue( $params[8]->getName() == 'participatedUsers');
$this->assertTrue( $params[8]->isArray() == false);
$this->assertTrue( $params[8]->isOptional () == false);
$this->assertTrue( $params[9]->getName() == 'participatedUsersStartedByUser');
$this->assertTrue( $params[9]->isArray() == false);
$this->assertTrue( $params[9]->isOptional () == false);
$this->assertTrue( $params[10]->getName() == 'participatedUsersCompletedByUser');
$this->assertTrue( $params[10]->isArray() == false);
$this->assertTrue( $params[10]->isOptional () == false);
$this->assertTrue( $params[11]->getName() == 'unassignedUsers');
$this->assertTrue( $params[11]->isArray() == false);
$this->assertTrue( $params[11]->isOptional () == false);
$this->assertTrue( $params[12]->getName() == 'unassignedGroups');
$this->assertTrue( $params[12]->isArray() == false);
$this->assertTrue( $params[12]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getApplicationIndexData
* @todo Implement testgetApplicationIndexData().
*/
public function testgetApplicationIndexData()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getApplicationIndexData', $methods ), 'exists method getApplicationIndexData' );
$r = new ReflectionMethod('AppSolr', 'getApplicationIndexData');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'AppUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::aaGetMaximun
* @todo Implement testaaGetMaximun().
*/
public function testaaGetMaximun()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('aaGetMaximun', $methods ), 'exists method aaGetMaximun' );
$r = new ReflectionMethod('AppSolr', 'aaGetMaximun');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'arr');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'column');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'columnType');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'STRING');
$this->assertTrue( $params[3]->getName() == 'columnCondition');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
$this->assertTrue( $params[4]->getName() == 'condition');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == true);
$this->assertTrue( $params[4]->getDefaultValue() == '');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::aaGetMinimun
* @todo Implement testaaGetMinimun().
*/
public function testaaGetMinimun()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('aaGetMinimun', $methods ), 'exists method aaGetMinimun' );
$r = new ReflectionMethod('AppSolr', 'aaGetMinimun');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'arr');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'column');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'columnType');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'STRING');
$this->assertTrue( $params[3]->getName() == 'columnCondition');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
$this->assertTrue( $params[4]->getName() == 'condition');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == true);
$this->assertTrue( $params[4]->getDefaultValue() == '');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::aaSearchRecords
* @todo Implement testaaSearchRecords().
*/
public function testaaSearchRecords()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('aaSearchRecords', $methods ), 'exists method aaSearchRecords' );
$r = new ReflectionMethod('AppSolr', 'aaSearchRecords');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'arr');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'andColumnsConditions');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getApplicationDelegationData
* @todo Implement testgetApplicationDelegationData().
*/
public function testgetApplicationDelegationData()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getApplicationDelegationData', $methods ), 'exists method getApplicationDelegationData' );
$r = new ReflectionMethod('AppSolr', 'getApplicationDelegationData');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'AppUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getTaskUnassignedUsersGroupsData
* @todo Implement testgetTaskUnassignedUsersGroupsData().
*/
public function testgetTaskUnassignedUsersGroupsData()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getTaskUnassignedUsersGroupsData', $methods ), 'exists method getTaskUnassignedUsersGroupsData' );
$r = new ReflectionMethod('AppSolr', 'getTaskUnassignedUsersGroupsData');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'ProUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'TaskUID');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getProcessDynaformFileNames
* @todo Implement testgetProcessDynaformFileNames().
*/
public function testgetProcessDynaformFileNames()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getProcessDynaformFileNames', $methods ), 'exists method getProcessDynaformFileNames' );
$r = new ReflectionMethod('AppSolr', 'getProcessDynaformFileNames');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'ProUID');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::applicationChangedUpdateSolrQueue
* @todo Implement testapplicationChangedUpdateSolrQueue().
*/
public function testapplicationChangedUpdateSolrQueue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('applicationChangedUpdateSolrQueue', $methods ), 'exists method applicationChangedUpdateSolrQueue' );
$r = new ReflectionMethod('AppSolr', 'applicationChangedUpdateSolrQueue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'AppUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'updated');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::synchronizePendingApplications
* @todo Implement testsynchronizePendingApplications().
*/
public function testsynchronizePendingApplications()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('synchronizePendingApplications', $methods ), 'exists method synchronizePendingApplications' );
$r = new ReflectionMethod('AppSolr', 'synchronizePendingApplications');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getCountApplicationsPMOS2
* @todo Implement testgetCountApplicationsPMOS2().
*/
public function testgetCountApplicationsPMOS2()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getCountApplicationsPMOS2', $methods ), 'exists method getCountApplicationsPMOS2' );
$r = new ReflectionMethod('AppSolr', 'getCountApplicationsPMOS2');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getCountApplicationsSearchIndex
* @todo Implement testgetCountApplicationsSearchIndex().
*/
public function testgetCountApplicationsSearchIndex()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getCountApplicationsSearchIndex', $methods ), 'exists method getCountApplicationsSearchIndex' );
$r = new ReflectionMethod('AppSolr', 'getCountApplicationsSearchIndex');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::getPagedApplicationUids
* @todo Implement testgetPagedApplicationUids().
*/
public function testgetPagedApplicationUids()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getPagedApplicationUids', $methods ), 'exists method getPagedApplicationUids' );
$r = new ReflectionMethod('AppSolr', 'getPagedApplicationUids');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'skip');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'pagesize');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers AppSolr::reindexAllApplications
* @todo Implement testreindexAllApplications().
*/
public function testreindexAllApplications()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('reindexAllApplications', $methods ), 'exists method reindexAllApplications' );
$r = new ReflectionMethod('AppSolr', 'reindexAllApplications');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -0,0 +1,84 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.AppSolr.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:32.
*/
class classApplicationWithoutDelegationRecordsExceptionTest extends PHPUnit_Framework_TestCase
{
/**
* @var ApplicationWithoutDelegationRecordsException
*/
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 ApplicationWithoutDelegationRecordsException();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 8);
}
/**
* @covers ApplicationWithoutDelegationRecordsException::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('ApplicationWithoutDelegationRecordsException', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'message');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'code');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '0');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers ApplicationWithoutDelegationRecordsException::__toString
* @todo Implement test__toString().
*/
public function test__toString()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__toString', $methods ), 'exists method __toString' );
$r = new ReflectionMethod('ApplicationWithoutDelegationRecordsException', '__toString');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -0,0 +1,258 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.solr.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:38.
*/
class classBpmnEngine_SearchIndexAccess_SolrTest extends PHPUnit_Framework_TestCase
{
/**
* @var BpmnEngine_SearchIndexAccess_Solr
*/
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 BpmnEngine_SearchIndexAccess_Solr();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 12);
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrIsEnabled');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
$this->assertTrue( $params[1]->getName() == 'solrHost');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::isEnabled
* @todo Implement testisEnabled().
*/
public function testisEnabled()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('isEnabled', $methods ), 'exists method isEnabled' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'isEnabled');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::getNumberDocuments
* @todo Implement testgetNumberDocuments().
*/
public function testgetNumberDocuments()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getNumberDocuments', $methods ), 'exists method getNumberDocuments' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'getNumberDocuments');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::executeQuery
* @todo Implement testexecuteQuery().
*/
public function testexecuteQuery()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('executeQuery', $methods ), 'exists method executeQuery' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'executeQuery');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrRequestData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::updateDocument
* @todo Implement testupdateDocument().
*/
public function testupdateDocument()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('updateDocument', $methods ), 'exists method updateDocument' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'updateDocument');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrUpdateDocument');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::commitChanges
* @todo Implement testcommitChanges().
*/
public function testcommitChanges()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('commitChanges', $methods ), 'exists method commitChanges' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'commitChanges');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::rollbackChanges
* @todo Implement testrollbackChanges().
*/
public function testrollbackChanges()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('rollbackChanges', $methods ), 'exists method rollbackChanges' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'rollbackChanges');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::optimizeChanges
* @todo Implement testoptimizeChanges().
*/
public function testoptimizeChanges()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('optimizeChanges', $methods ), 'exists method optimizeChanges' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'optimizeChanges');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::getListIndexedStoredFields
* @todo Implement testgetListIndexedStoredFields().
*/
public function testgetListIndexedStoredFields()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getListIndexedStoredFields', $methods ), 'exists method getListIndexedStoredFields' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'getListIndexedStoredFields');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::deleteAllDocuments
* @todo Implement testdeleteAllDocuments().
*/
public function testdeleteAllDocuments()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('deleteAllDocuments', $methods ), 'exists method deleteAllDocuments' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'deleteAllDocuments');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::deleteDocument
* @todo Implement testdeleteDocument().
*/
public function testdeleteDocument()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('deleteDocument', $methods ), 'exists method deleteDocument' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'deleteDocument');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idQuery');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_SearchIndexAccess_Solr::getFacetsList
* @todo Implement testgetFacetsList().
*/
public function testgetFacetsList()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getFacetsList', $methods ), 'exists method getFacetsList' );
$r = new ReflectionMethod('BpmnEngine_SearchIndexAccess_Solr', 'getFacetsList');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'facetRequest');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -0,0 +1,207 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.searchIndex.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:38.
*/
class classBpmnEngine_Services_SearchIndexTest extends PHPUnit_Framework_TestCase
{
/**
* @var BpmnEngine_Services_SearchIndex
*/
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 BpmnEngine_Services_SearchIndex();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 9);
}
/**
* @covers BpmnEngine_Services_SearchIndex::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrIsEnabled');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
$this->assertTrue( $params[1]->getName() == 'solrHost');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::isEnabled
* @todo Implement testisEnabled().
*/
public function testisEnabled()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('isEnabled', $methods ), 'exists method isEnabled' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'isEnabled');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::getFacetsList
* @todo Implement testgetFacetsList().
*/
public function testgetFacetsList()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getFacetsList', $methods ), 'exists method getFacetsList' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'getFacetsList');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'facetRequestEntity');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::getNumberDocuments
* @todo Implement testgetNumberDocuments().
*/
public function testgetNumberDocuments()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getNumberDocuments', $methods ), 'exists method getNumberDocuments' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'getNumberDocuments');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::updateIndexDocument
* @todo Implement testupdateIndexDocument().
*/
public function testupdateIndexDocument()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('updateIndexDocument', $methods ), 'exists method updateIndexDocument' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'updateIndexDocument');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrUpdateDocumentEntity');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::deleteDocumentFromIndex
* @todo Implement testdeleteDocumentFromIndex().
*/
public function testdeleteDocumentFromIndex()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('deleteDocumentFromIndex', $methods ), 'exists method deleteDocumentFromIndex' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'deleteDocumentFromIndex');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idQuery');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::commitIndexChanges
* @todo Implement testcommitIndexChanges().
*/
public function testcommitIndexChanges()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('commitIndexChanges', $methods ), 'exists method commitIndexChanges' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'commitIndexChanges');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::getDataTablePaginatedList
* @todo Implement testgetDataTablePaginatedList().
*/
public function testgetDataTablePaginatedList()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getDataTablePaginatedList', $methods ), 'exists method getDataTablePaginatedList' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'getDataTablePaginatedList');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'solrRequestData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers BpmnEngine_Services_SearchIndex::getIndexFields
* @todo Implement testgetIndexFields().
*/
public function testgetIndexFields()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getIndexFields', $methods ), 'exists method getIndexFields' );
$r = new ReflectionMethod('BpmnEngine_Services_SearchIndex', 'getIndexFields');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'workspace');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -0,0 +1,124 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.fileCache.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:38.
*/
class classFileCacheTest extends PHPUnit_Framework_TestCase
{
/**
* @var FileCache
*/
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 FileCache();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 4);
}
/**
* @covers FileCache::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('FileCache', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'dir');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers FileCache::get
* @todo Implement testget().
*/
public function testget()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('get', $methods ), 'exists method get' );
$r = new ReflectionMethod('FileCache', 'get');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'key');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'expiration');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '3600');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers FileCache::set
* @todo Implement testset().
*/
public function testset()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('set', $methods ), 'exists method set' );
$r = new ReflectionMethod('FileCache', 'set');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'key');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'data');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers FileCache::clear
* @todo Implement testclear().
*/
public function testclear()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('clear', $methods ), 'exists method clear' );
$r = new ReflectionMethod('FileCache', 'clear');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'key');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -0,0 +1,84 @@
<?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';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.AppSolr.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:32.
*/
class classInvalidIndexSearchTextExceptionTest extends PHPUnit_Framework_TestCase
{
/**
* @var InvalidIndexSearchTextException
*/
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 InvalidIndexSearchTextException();
}
/**
* 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
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$this->assertTrue( count($methods) == 8);
}
/**
* @covers InvalidIndexSearchTextException::__construct
* @todo Implement test__construct().
*/
public function test__construct()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__construct', $methods ), 'exists method __construct' );
$r = new ReflectionMethod('InvalidIndexSearchTextException', '__construct');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'message');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'code');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '0');
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @covers InvalidIndexSearchTextException::__toString
* @todo Implement test__toString().
*/
public function test__toString()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('__toString', $methods ), 'exists method __toString' );
$r = new ReflectionMethod('InvalidIndexSearchTextException', '__toString');
$params = $r->getParameters();
$this->markTestIncomplete('This test has not been implemented yet.');
}
}

View File

@@ -13,6 +13,8 @@ define('PATH_TRUNK', realpath(__DIR__ . '/../') . PATH_SEP);
define('PATH_HOME', PATH_TRUNK . 'workflow' . PATH_SEP); define('PATH_HOME', PATH_TRUNK . 'workflow' . PATH_SEP);
define('SYS_SYS', $GLOBALS['SYS_SYS']); define('SYS_SYS', $GLOBALS['SYS_SYS']);
define('SYS_LANG', $GLOBALS['SYS_LANG']);
define('SYS_SKIN', $GLOBALS['SYS_SKIN']);
require PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php'; require PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php';

View File

@@ -1,54 +1,85 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/** /**
this file is used to generate test units for all files folders in processmaker class folder this file is used to generate test units for all files folders in processmaker class folder
*/ */
define('ROOT_PATH', realpath(dirname(__FILE__) . '/..') . '/');
global $tokens;
global $dispatchIniFile;
global $fp;
$dispatchIniFile = ROOT_PATH . "configs/dispatch.ini"; define('ROOT_PATH', realpath(dirname(__FILE__) . '/../..') . '/');
$inputDir = ROOT_PATH . 'businessLogic/modules/home/Services'; global $tokens;
global $dispatchIniFile;
// $fp = fopen( $dispatchIniFile , 'w'); global $fp;
global $outputDir;
//parsingFolder('gulliver/system', 'class.form.php class.objectTemplate.php class.tree.php class.xmlform.php class.filterForm.php'); $dispatchIniFile = ROOT_PATH . "configs/dispatch.ini";
//parsingFolder('gulliver/system', ''); $inputDir = ROOT_PATH . 'businessLogic/modules/home/Services';
parsingFolder('workflow/engine/classes', ''); $outputDir = ROOT_PATH . 'tests/automated/';
function parsingFolder ( $folder, $exceptionsText ) { print "Output directory: $outputDir\n";
define ('PATH_GULLIVER', ROOT_PATH . 'gulliver/system/');
define ('PATH_THIRDPARTY', ROOT_PATH . 'gulliver/thirdparty/');
define ('PATH_CORE', ROOT_PATH . 'workflow/engine');
define ('SYS_SKIN', 'classic');
define ('SYS_LANG', 'en');
// set include path
set_include_path(
PATH_CORE . PATH_SEPARATOR .
PATH_THIRDPARTY . PATH_SEPARATOR .
PATH_THIRDPARTY . 'pear'. PATH_SEPARATOR .
get_include_path()
);
require_once ROOT_PATH . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once ROOT_PATH . 'gulliver/system/class.g.php';
require_once ROOT_PATH . 'gulliver/system/class.xmlform.php';
require_once ROOT_PATH . 'gulliver/system/class.xmlDocument.php';
require_once ROOT_PATH . 'gulliver/system/class.form.php';
require_once ROOT_PATH . 'gulliver/thirdparty/propel/Propel.php';
require_once ROOT_PATH . 'gulliver/system/class.dbtable.php';
require_once ROOT_PATH . 'gulliver/system/class.dbconnection.php';
//parsingFolder('gulliver/system', 'class.form.php class.objectTemplate.php class.tree.php class.xmlform.php class.filterForm.php');
parsingFolder('gulliver/system', 'class.database_mssql.php class.database_mysql.php class.htmlArea.php ' .
'class.dbconnection.php class.dbrecordset.php class.dbsession.php class.soapNtlm.php' );
parsingFolder('workflow/engine/classes',
'class.xmlfield_Image.php class.groupUser.php class.group.php class.system.php ' .
'class.ArrayPeer.php class.ArrayPeer.php class.BasePeer.php class.dbConnections.php class.webdav.php');
function parsingFolder ( $folder, $exceptionsText )
{
$baseDir = ROOT_PATH; $baseDir = ROOT_PATH;
$exceptions = explode( ' ', trim($exceptionsText) ) ; $exceptions = explode(' ', trim($exceptionsText)) ;
if ($handle = opendir( $baseDir . $folder) ) { if ($handle = opendir( $baseDir . $folder)) {
while (false !== ($entry = readdir($handle))) { while (false !== ($entry = readdir($handle))) {
if ( is_dir($baseDir . $folder . '/' . $entry) ) { if ( is_dir($baseDir . $folder . '/' . $entry) ) {
} }
if ( is_file($baseDir . $folder . '/' . $entry) && substr($entry,-4) == ".php" && substr($entry,0,6) == "class." ) { if ( is_file($baseDir . $folder . '/' . $entry) && substr($entry,-4) == ".php" && substr($entry,0,6) == "class." ) {
if ( !in_array($entry,$exceptions) ) { if ( !in_array($entry,$exceptions) ) {
//print "parsing $baseDir$folder/$entry \n"; //print "parsing $baseDir$folder/$entry \n";
parsingFile ( $folder , $entry); parsingFile ( $folder , $entry);
} }
} }
} }
closedir($handle); closedir($handle);
} }
} }
function parsingFile ( $folder, $entry ) { function parsingFile ( $folder, $entry )
{
global $tokens; global $tokens;
global $fp; global $fp;
global $outputDir;
$baseDir = ROOT_PATH; $baseDir = ROOT_PATH;
$outputDir = ROOT_PATH . 'tests/';
$file = $baseDir . $folder . '/' . $entry; $file = $baseDir . $folder . '/' . $entry;
$content = file_get_contents ( $file ); $content = file_get_contents ( $file );
//get all tokens //get all tokens
$tokens = token_get_all ($content); $tokens = token_get_all ($content);
//remove spaces //remove spaces
$temp = array(); $temp = array();
foreach ( $tokens as $k => $token ) { foreach ( $tokens as $k => $token ) {
@@ -60,61 +91,100 @@
} }
} }
$tokens = $temp; $tokens = $temp;
$className = ''; $className = '';
$comments = ''; $comments = '';
$path = '/' . str_replace (ROOT_PATH, '', $file); $path = '/' . str_replace (ROOT_PATH, '', $file);
$atLeastOneClass = false; $atLeastOneClass = false;
foreach ( $tokens as $k => $token ) { foreach ( $tokens as $k => $token ) {
if ( is_array($token) ) { if ( is_array($token) ) {
//looking for classes //looking for classes
if ( $token[0] == T_CLASS ) { if ( $token[0] == T_CLASS ) {
if ( $atLeastOneClass ) { if ( $atLeastOneClass ) {
fprintf ( $fp, " } \n" ); fprintf ( $fp, " } \n" );
} }
$atLeastOneClass = true; $atLeastOneClass = true;
$className = nextToken( T_STRING, $k ); $className = nextToken( T_STRING, $k );
print "--> $className\n"; if (strpos(strtolower($entry), strtolower($className))) {
print "--> $className\n";
} else {
print "--> $className ($entry)\n";
}
$classFile = $folder . '/' . $entry; $classFile = $folder . '/' . $entry;
if ( !is_dir($outputDir . $folder)) { if ( !is_dir($outputDir . $folder)) {
mkdir($outputDir . $folder, 0777, true); mkdir($outputDir . $folder, 0777, true);
} }
$fp = fopen ( $outputDir . $folder . '/class' . $className . 'Test.php', 'w' ); $fp = fopen ( $outputDir . $folder . '/class' . $className . 'Test.php', 'w');
fprintf ( $fp, "<?php \n" ); fprintf ( $fp, "<?php\n" );
fprintf ( $fp, " require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php'; \n" ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';\n");
fprintf ( $fp, " require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php'; \n" ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';\n");
fprintf ( $fp, " require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php'; \n" ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';\n");
fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/system/class.form.php';\n");
fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';\n");
// setup propel definitions and logging // setup propel definitions and logging
fprintf ( $fp, " require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php' ;\n" ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';\n");
fprintf ( $fp, " require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php' ;\n" ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';\n");
fprintf ( $fp, " require_once PATH_TRUNK . '%s/%s'; \n\n", $folder, $entry ); fprintf ( $fp, "require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';\n");
fprintf ( $fp, " /** \n" ); fprintf ( $fp, "require_once PATH_TRUNK . '%s/%s';\n\n", $folder, $entry);
fprintf ( $fp, " * Generated by ProcessMaker Test Unit Generator on %s at %s.\n", date('Y-m-d'), date('H:i:s') ); require_once ROOT_PATH . "$folder/$entry";
fprintf ( $fp, " */ \n\n" ); fprintf ( $fp, "/**\n");
fprintf ( $fp, " class class%sTest extends PHPUnit_Framework_TestCase \n", $className ); fprintf ( $fp, " * Generated by ProcessMaker Test Unit Generator on %s at %s.\n", date('Y-m-d'), date('H:i:s'));
fprintf ( $fp, " { \n" ); fprintf ( $fp, "*/\n\n");
fprintf ( $fp, "class class%sTest extends PHPUnit_Framework_TestCase\n", $className);
fprintf ( $fp, "{\n" );
fprintf ( $fp, " /**\n");
fprintf ( $fp, " * @var %s\n",$className);
fprintf ( $fp, " */\n");
fprintf ( $fp, " protected \$object;\n\n");
fprintf ( $fp, " /**\n" );
fprintf ( $fp, " * Sets up the fixture, for example, opens a network connection.\n" );
fprintf ( $fp, " * This method is called before a test is executed.\n" );
fprintf ( $fp, " */\n" );
fprintf ( $fp, " protected function setUp()\n");
fprintf ( $fp, " {\n");
fprintf ( $fp, " \$this->object = new %s();\n", $className);
fprintf ( $fp, " }\n\n");
fprintf ( $fp, " /**\n" );
fprintf ( $fp, " * Tears down the fixture, for example, closes a network connection.\n" );
fprintf ( $fp, " * This method is called after a test is executed.\n" );
fprintf ( $fp, " */\n" );
fprintf ( $fp, " protected function tearDown()\n");
fprintf ( $fp, " {\n");
fprintf ( $fp, " }\n");
fprintf ( $fp, "\n");
$methods = get_class_methods($className);
fprintf ( $fp, " /**\n" );
fprintf ( $fp, " * This is the default method to test, if the class still having \n" );
fprintf ( $fp, " * the same number of methods.\n" );
fprintf ( $fp, " */\n" );
fprintf ( $fp, " public function testNumberOfMethodsInThisClass()\n");
fprintf ( $fp, " {\n");
fprintf ( $fp, " \$this->assertTrue( count(\$methods) == %s);\n", count($methods) );
fprintf ( $fp, " }\n");
fprintf ( $fp, "\n");
} }
if ( $token[0] == T_FUNCTION ) { if ( $token[0] == T_FUNCTION ) {
$functionName = nextToken( T_STRING, $k ); $functionName = nextToken( T_STRING, $k );
$public = previousToken( T_PUBLIC, $k ); $public = previousToken( T_PUBLIC, $k );
$comments = previousToken( T_DOC_COMMENT, $k ); $comments = previousToken( T_DOC_COMMENT, $k );
parseFunction ( $k, $path, $className, $functionName, $comments); parseFunction ( $k, $path, $className, $functionName, $comments);
//if ( strtolower($public) == 'public' ) parsePublic ( $path, $className, $functionName, $comments ); //if ( strtolower($public) == 'public' ) parsePublic ( $path, $className, $functionName, $comments );
} }
} }
} }
if ( $atLeastOneClass ) { if ( $atLeastOneClass ) {
fprintf ( $fp, " } \n" ); fprintf ( $fp, " } \n" );
} }
}
}
/* /*
[GetCaseInfo] [GetCaseInfo]
class = BpmnEngine_Services_Case class = BpmnEngine_Services_Case
path = /businessLogic/modules/bpmnEngine/Services/Case.php path = /businessLogic/modules/bpmnEngine/Services/Case.php
gearman = false gearman = false
@@ -127,49 +197,59 @@
global $tokens; global $tokens;
if ( trim($className) == '' ) return; if ( trim($className) == '' ) return;
$comm = explode ("\n", $comments); $comm = explode ("\n", $comments);
$params = array(); $params = array();
//print " --> $functionName ( "; //print " --> $functionName ( ";
//search for first ( open parenthesis //search for first ( open parenthesis
$openParenthesis = false; $openParenthesis = false;
$closeParenthesis = false; $closeParenthesis = false;
while ( ! $openParenthesis ) { while ( ! $openParenthesis ) {
if (! is_array($tokens[$k]) && $tokens[$k] == '(' ) if (! is_array($tokens[$k]) && $tokens[$k] == '(' )
$openParenthesis = true; $openParenthesis = true;
$k++; $k++;
} }
while ( ! $closeParenthesis ) { while ( ! $closeParenthesis ) {
if (is_array($tokens[$k]) && $tokens[$k][0] == T_VARIABLE ) { if (is_array($tokens[$k]) && $tokens[$k][0] == T_VARIABLE ) {
//print " " . $tokens[$k][1]; //print " " . $tokens[$k][1];
} }
if (! is_array($tokens[$k]) && $tokens[$k] == ')' ) { if (! is_array($tokens[$k]) && $tokens[$k] == ')' ) {
$closeParenthesis = true; $closeParenthesis = true;
//print " \n"; //print " \n";
} }
$k++; $k++;
}
$methods = get_class_methods($className);
if (!in_array($functionName, $methods ) ) {
return;
} }
fprintf ( $fp, " /**\n" ); fprintf ( $fp, " /**\n" );
fprintf ( $fp, " * @covers %s::%s\n", $className, $functionName ); fprintf ( $fp, " * @covers %s::%s\n", $className, $functionName );
fprintf ( $fp, " * @todo Implement test%s().\n", $functionName ); fprintf ( $fp, " * @todo Implement test%s().\n", $functionName );
fprintf ( $fp, " */\n" ); fprintf ( $fp, " */\n" );
fprintf ( $fp, " public function test%s() \n", $functionName ); fprintf ( $fp, " public function test%s()\n", $functionName );
fprintf ( $fp, " { \n" ); fprintf ( $fp, " {\n" );
fprintf ( $fp, " if (class_exists('%s')) {\n ", $className ); fprintf ( $fp, " \$methods = get_class_methods(\$this->object);\n");
fprintf ( $fp, " \$methods = get_class_methods( '%s');\n", $className ); fprintf ( $fp, " \$this->assertTrue( in_array('%s', \$methods ), 'exists method %s' );\n",$functionName,$functionName);
fprintf ( $fp, " \$this->assertTrue( in_array( '%s', \$methods ), 'seems like this function is outside this class' ); \n", $functionName ); fprintf ( $fp, " \$r = new ReflectionMethod('%s', '%s');\n", $className, $functionName );
// fprintf ( $fp, " \$x = new %s(); \n", $className ); fprintf ( $fp, " \$params = \$r->getParameters();\n");
// fprintf ( $fp, " \$this->assertTrue( is_a(\$x, '%s') ); \n", $className ); $r = new ReflectionMethod($className, $functionName);
fprintf ( $fp, " } \n" ); $params = $r->getParameters();
foreach ( $params as $key=>$param) {
fprintf ( $fp, " \$this->assertTrue( \$params[$key]->getName() == '%s');\n", $param->getName());
fprintf ( $fp, " \$this->assertTrue( \$params[$key]->isArray() == %s);\n", $param->isArray() == true ? 'true':'false');
fprintf ( $fp, " \$this->assertTrue( \$params[$key]->isOptional () == %s);\n", $param->isOptional() == true ? 'true':'false');
if ($param->isOptional()) {
fprintf ( $fp, " \$this->assertTrue( \$params[$key]->getDefaultValue() == '%s');\n", $param->getDefaultValue() );
}
}
fprintf ( $fp, " \$this->markTestIncomplete('This test has not been implemented yet.');\n\n");
fprintf ( $fp, " } \n\n" ); fprintf ( $fp, " } \n\n" );
//fprintf ( $fp, "[$functionName]\n class = $className\n path = $path\n" );
//fprintf ( $fp, "\n" );
} }
function parsePublic ( $path, $className, $functionName, $comments ) { function parsePublic ( $path, $className, $functionName, $comments ) {
global $fp; global $fp;
$comm = explode ("\n", $comments); $comm = explode ("\n", $comments);
@@ -188,9 +268,9 @@
fprintf ( $fp, " rest = " . ($rest == 'true' ? 'true' : 'false') . "\n" ); fprintf ( $fp, " rest = " . ($rest == 'true' ? 'true' : 'false') . "\n" );
fprintf ( $fp, "\n" ); fprintf ( $fp, "\n" );
} }
function nextToken( $type, $k ) { function nextToken( $type, $k ) {
global $tokens; global $tokens;
do { do {
@@ -206,7 +286,7 @@
return ''; return '';
} }
} }
function previousToken( $type, $k ) { function previousToken( $type, $k ) {
global $tokens; global $tokens;
do { do {
@@ -223,5 +303,5 @@
return ''; return '';
} }
} }