191 lines
7.7 KiB
PHP
191 lines
7.7 KiB
PHP
<?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 22:32:30.
|
|
*/
|
|
|
|
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()
|
|
{
|
|
$methods = get_class_methods('BpmnEngine_Services_SearchIndex');
|
|
$this->assertTrue( count($methods) == 10);
|
|
}
|
|
|
|
/**
|
|
* @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() == '');
|
|
}
|
|
|
|
/**
|
|
* @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();
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
/**
|
|
* @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);
|
|
}
|
|
|
|
}
|