226 lines
8.4 KiB
PHP
226 lines
8.4 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.xmlDb.php';
|
|
|
|
/**
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:32.
|
|
*/
|
|
|
|
class classXMLConnectionTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var XMLConnection
|
|
*/
|
|
protected $object;
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
protected function setUp()
|
|
{
|
|
$file = PATH_TRUNK . 'workflow/engine/xmlform/login/login.xml';
|
|
$this->object = new XMLConnection($file);
|
|
}
|
|
|
|
/**
|
|
* 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('XMLConnection');
|
|
$this->assertTrue( count($methods) == 11);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::XMLConnection
|
|
* @todo Implement testXMLConnection().
|
|
*/
|
|
public function testXMLConnection()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('XMLConnection', $methods ), 'exists method XMLConnection' );
|
|
$r = new ReflectionMethod('XMLConnection', 'XMLConnection');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'file');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::query
|
|
* @todo Implement testquery().
|
|
*/
|
|
public function testquery()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('query', $methods ), 'exists method query' );
|
|
$r = new ReflectionMethod('XMLConnection', 'query');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sql');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::sqlLike
|
|
* @todo Implement testsqlLike().
|
|
*/
|
|
public function testsqlLike()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('sqlLike', $methods ), 'exists method sqlLike' );
|
|
$r = new ReflectionMethod('XMLConnection', 'sqlLike');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'a');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'b');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::expandFields
|
|
* @todo Implement testexpandFields().
|
|
*/
|
|
public function testexpandFields()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('expandFields', $methods ), 'exists method expandFields' );
|
|
$r = new ReflectionMethod('XMLConnection', 'expandFields');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'resRow');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'fieldsList');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::fetchNode
|
|
* @todo Implement testfetchNode().
|
|
*/
|
|
public function testfetchNode()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('fetchNode', $methods ), 'exists method fetchNode' );
|
|
$r = new ReflectionMethod('XMLConnection', 'fetchNode');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'node');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::fetchChildren
|
|
* @todo Implement testfetchChildren().
|
|
*/
|
|
public function testfetchChildren()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('fetchChildren', $methods ), 'exists method fetchChildren' );
|
|
$r = new ReflectionMethod('XMLConnection', 'fetchChildren');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'node');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::disconnect
|
|
* @todo Implement testdisconnect().
|
|
*/
|
|
public function testdisconnect()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('disconnect', $methods ), 'exists method disconnect' );
|
|
$r = new ReflectionMethod('XMLConnection', 'disconnect');
|
|
$params = $r->getParameters();
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::sqlWhereLike
|
|
* @todo Implement testsqlWhereLike().
|
|
*/
|
|
public function testsqlWhereLike()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('sqlWhereLike', $methods ), 'exists method sqlWhereLike' );
|
|
$r = new ReflectionMethod('XMLConnection', 'sqlWhereLike');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'match');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::sqlString
|
|
* @todo Implement testsqlString().
|
|
*/
|
|
public function testsqlString()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('sqlString', $methods ), 'exists method sqlString' );
|
|
$r = new ReflectionMethod('XMLConnection', 'sqlString');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'match');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::insertRow
|
|
* @todo Implement testinsertRow().
|
|
*/
|
|
public function testinsertRow()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('insertRow', $methods ), 'exists method insertRow' );
|
|
$r = new ReflectionMethod('XMLConnection', 'insertRow');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'node');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'values');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers XMLConnection::updateRow
|
|
* @todo Implement testupdateRow().
|
|
*/
|
|
public function testupdateRow()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('updateRow', $methods ), 'exists method updateRow' );
|
|
$r = new ReflectionMethod('XMLConnection', 'updateRow');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'node');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'values');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
}
|