php units for all classes
This commit is contained in:
@@ -1,39 +1,87 @@
|
||||
<?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/thirdparty/propel/Propel.php' ;
|
||||
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php' ;
|
||||
require_once PATH_TRUNK . 'workflow/engine/classes/class.xmlDb.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-05-10 at 20:56:18.
|
||||
*/
|
||||
/**
|
||||
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 20:28:40.
|
||||
*/
|
||||
|
||||
class classXMLDBTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var XMLDB
|
||||
*/
|
||||
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 XMLDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) == 2);
|
||||
}
|
||||
|
||||
class classXMLDBTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers XMLDB::connect
|
||||
* @todo Implement testconnect().
|
||||
*/
|
||||
public function testconnect()
|
||||
{
|
||||
if (class_exists('XMLDB')) {
|
||||
$methods = get_class_methods( 'XMLDB');
|
||||
$this->assertTrue( in_array( 'connect', $methods ), 'seems like this function is outside this class' );
|
||||
}
|
||||
public function testconnect()
|
||||
{
|
||||
$methods = get_class_methods($this->object);
|
||||
$this->assertTrue( in_array('connect', $methods ), 'exists method connect' );
|
||||
$r = new ReflectionMethod('XMLDB', 'connect');
|
||||
$params = $r->getParameters();
|
||||
$this->assertTrue( $params[0]->getName() == 'dsn');
|
||||
$this->assertTrue( $params[0]->isArray() == false);
|
||||
$this->assertTrue( $params[0]->isOptional () == false);
|
||||
$this->assertTrue( $params[1]->getName() == 'options');
|
||||
$this->assertTrue( $params[1]->isArray() == false);
|
||||
$this->assertTrue( $params[1]->isOptional () == true);
|
||||
$this->assertTrue( $params[1]->getDefaultValue() == 'Array');
|
||||
$this->markTestIncomplete('This test has not been implemented yet.');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers XMLDB::isError
|
||||
* @todo Implement testisError().
|
||||
*/
|
||||
public function testisError()
|
||||
{
|
||||
if (class_exists('XMLDB')) {
|
||||
$methods = get_class_methods( 'XMLDB');
|
||||
$this->assertTrue( in_array( 'isError', $methods ), 'seems like this function is outside this class' );
|
||||
}
|
||||
public function testisError()
|
||||
{
|
||||
$methods = get_class_methods($this->object);
|
||||
$this->assertTrue( in_array('isError', $methods ), 'exists method isError' );
|
||||
$r = new ReflectionMethod('XMLDB', 'isError');
|
||||
$params = $r->getParameters();
|
||||
$this->assertTrue( $params[0]->getName() == 'result');
|
||||
$this->assertTrue( $params[0]->isArray() == false);
|
||||
$this->assertTrue( $params[0]->isOptional () == false);
|
||||
$this->markTestIncomplete('This test has not been implemented yet.');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user