2012-07-12 20:40:06 -04:00
|
|
|
<?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.calendar.php';
|
2012-05-10 20:57:25 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
/**
|
2012-07-12 22:34:02 -04:00
|
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:26.
|
2012-07-12 20:40:06 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class classcalendarTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var calendar
|
|
|
|
|
*/
|
|
|
|
|
protected $object;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
|
|
|
* This method is called before a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function setUp()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
$userUid = '';
|
|
|
|
|
$proUid = '';
|
|
|
|
|
$tasUid = '';
|
|
|
|
|
//$this->object = new calendar($userUid, $proUid, $tasUid);
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tears down the fixture, for example, closes a network connection.
|
|
|
|
|
* This method is called after a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function tearDown()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-07-14 02:33:26 -04:00
|
|
|
* This is the default method to test, if the class still having
|
2012-07-12 20:40:06 -04:00
|
|
|
* the same number of methods.
|
|
|
|
|
*/
|
|
|
|
|
public function testNumberOfMethodsInThisClass()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
$methods = get_class_methods('calendar');
|
|
|
|
|
$this->assertTrue( count($methods) == 56);
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers calendar::calendar
|
|
|
|
|
* @todo Implement testcalendar().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testcalendar()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
//$methods = get_class_methods($this->object);
|
|
|
|
|
$methods = get_class_methods('calendar');
|
2012-07-12 20:40:06 -04:00
|
|
|
$this->assertTrue( in_array('calendar', $methods ), 'exists method calendar' );
|
|
|
|
|
$r = new ReflectionMethod('calendar', 'calendar');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'userUid');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'proUid');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
|
|
|
$this->assertTrue( $params[2]->getName() == 'tasUid');
|
|
|
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[2]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[2]->getDefaultValue() == '');
|
2012-07-14 02:33:26 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers calendar::addCalendarLog
|
|
|
|
|
* @todo Implement testaddCalendarLog().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testaddCalendarLog()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
//$methods = get_class_methods($this->object);
|
|
|
|
|
$methods = get_class_methods('calendar');
|
2012-07-12 20:40:06 -04:00
|
|
|
$this->assertTrue( in_array('addCalendarLog', $methods ), 'exists method addCalendarLog' );
|
|
|
|
|
$r = new ReflectionMethod('calendar', 'addCalendarLog');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'msg');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-14 02:33:26 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers calendar::setupCalendar
|
|
|
|
|
* @todo Implement testsetupCalendar().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testsetupCalendar()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
//$methods = get_class_methods($this->object);
|
|
|
|
|
$methods = get_class_methods('calendar');
|
2012-07-12 20:40:06 -04:00
|
|
|
$this->assertTrue( in_array('setupCalendar', $methods ), 'exists method setupCalendar' );
|
|
|
|
|
$r = new ReflectionMethod('calendar', 'setupCalendar');
|
|
|
|
|
$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() == 'proUid');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[2]->getName() == 'tasUid');
|
|
|
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
2012-07-14 02:33:26 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers calendar::getNextValidBusinessHoursRange
|
|
|
|
|
* @todo Implement testgetNextValidBusinessHoursRange().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetNextValidBusinessHoursRange()
|
|
|
|
|
{
|
2012-07-14 02:33:26 -04:00
|
|
|
//$methods = get_class_methods($this->object);
|
|
|
|
|
$methods = get_class_methods('calendar');
|
2012-07-12 20:40:06 -04:00
|
|
|
$this->assertTrue( in_array('getNextValidBusinessHoursRange', $methods ), 'exists method getNextValidBusinessHoursRange' );
|
|
|
|
|
$r = new ReflectionMethod('calendar', 'getNextValidBusinessHoursRange');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'date');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'time');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-14 02:33:26 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
2012-07-14 02:33:26 -04:00
|
|
|
}
|