347 lines
13 KiB
PHP
347 lines
13 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 . 'gulliver/system/class.controller.php';
|
|
|
|
/**
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:23.
|
|
*/
|
|
|
|
class classControllerTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var Controller
|
|
*/
|
|
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 Controller();
|
|
}
|
|
|
|
/**
|
|
* 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('Controller'); $this->assertTrue( count($methods) == 19);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::__set
|
|
* @todo Implement test__set().
|
|
*/
|
|
public function test__set()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('__set', $methods ), 'exists method __set' );
|
|
$r = new ReflectionMethod('Controller', '__set');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'value');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::__get
|
|
* @todo Implement test__get().
|
|
*/
|
|
public function test__get()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('__get', $methods ), 'exists method __get' );
|
|
$r = new ReflectionMethod('Controller', '__get');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::__isset
|
|
* @todo Implement test__isset().
|
|
*/
|
|
public function test__isset()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('__isset', $methods ), 'exists method __isset' );
|
|
$r = new ReflectionMethod('Controller', '__isset');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::__unset
|
|
* @todo Implement test__unset().
|
|
*/
|
|
public function test__unset()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('__unset', $methods ), 'exists method __unset' );
|
|
$r = new ReflectionMethod('Controller', '__unset');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setResponseType
|
|
* @todo Implement testsetResponseType().
|
|
*/
|
|
public function testsetResponseType()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setResponseType', $methods ), 'exists method setResponseType' );
|
|
$r = new ReflectionMethod('Controller', 'setResponseType');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'type');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::call
|
|
* @todo Implement testcall().
|
|
*/
|
|
public function testcall()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('call', $methods ), 'exists method call' );
|
|
$r = new ReflectionMethod('Controller', 'call');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setHttpRequestData
|
|
* @todo Implement testsetHttpRequestData().
|
|
*/
|
|
public function testsetHttpRequestData()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setHttpRequestData', $methods ), 'exists method setHttpRequestData' );
|
|
$r = new ReflectionMethod('Controller', 'setHttpRequestData');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'data');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setDebug
|
|
* @todo Implement testsetDebug().
|
|
*/
|
|
public function testsetDebug()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setDebug', $methods ), 'exists method setDebug' );
|
|
$r = new ReflectionMethod('Controller', 'setDebug');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'val');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::getDebug
|
|
* @todo Implement testgetDebug().
|
|
*/
|
|
public function testgetDebug()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getDebug', $methods ), 'exists method getDebug' );
|
|
$r = new ReflectionMethod('Controller', 'getDebug');
|
|
$params = $r->getParameters();
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::includeExtJSLib
|
|
* @todo Implement testincludeExtJSLib().
|
|
*/
|
|
public function testincludeExtJSLib()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('includeExtJSLib', $methods ), 'exists method includeExtJSLib' );
|
|
$r = new ReflectionMethod('Controller', 'includeExtJSLib');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'srcFile');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'debug');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::includeExtJS
|
|
* @todo Implement testincludeExtJS().
|
|
*/
|
|
public function testincludeExtJS()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('includeExtJS', $methods ), 'exists method includeExtJS' );
|
|
$r = new ReflectionMethod('Controller', 'includeExtJS');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'srcFile');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'debug');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setView
|
|
* @todo Implement testsetView().
|
|
*/
|
|
public function testsetView()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setView', $methods ), 'exists method setView' );
|
|
$r = new ReflectionMethod('Controller', 'setView');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'file');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setJSVar
|
|
* @todo Implement testsetJSVar().
|
|
*/
|
|
public function testsetJSVar()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setJSVar', $methods ), 'exists method setJSVar' );
|
|
$r = new ReflectionMethod('Controller', 'setJSVar');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'value');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setVar
|
|
* @todo Implement testsetVar().
|
|
*/
|
|
public function testsetVar()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setVar', $methods ), 'exists method setVar' );
|
|
$r = new ReflectionMethod('Controller', 'setVar');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'value');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::getHeadPublisher
|
|
* @todo Implement testgetHeadPublisher().
|
|
*/
|
|
public function testgetHeadPublisher()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getHeadPublisher', $methods ), 'exists method getHeadPublisher' );
|
|
$r = new ReflectionMethod('Controller', 'getHeadPublisher');
|
|
$params = $r->getParameters();
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::setLayout
|
|
* @todo Implement testsetLayout().
|
|
*/
|
|
public function testsetLayout()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setLayout', $methods ), 'exists method setLayout' );
|
|
$r = new ReflectionMethod('Controller', 'setLayout');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'layout');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::render
|
|
* @todo Implement testrender().
|
|
*/
|
|
public function testrender()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('render', $methods ), 'exists method render' );
|
|
$r = new ReflectionMethod('Controller', 'render');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'type');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
$this->assertTrue( $params[0]->getDefaultValue() == 'mvc');
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::header
|
|
* @todo Implement testheader().
|
|
*/
|
|
public function testheader()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('header', $methods ), 'exists method header' );
|
|
$r = new ReflectionMethod('Controller', 'header');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'header');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Controller::redirect
|
|
* @todo Implement testredirect().
|
|
*/
|
|
public function testredirect()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('redirect', $methods ), 'exists method redirect' );
|
|
$r = new ReflectionMethod('Controller', 'redirect');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'url');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
}
|