Files
luos/tests/automated/gulliver/system/classunitTestTest.php

164 lines
6.3 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.unitTest.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:24.
*/
class classunitTestTest extends PHPUnit_Framework_TestCase
{
/**
* @var unitTest
*/
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 unitTest();
}
/**
* 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('unitTest'); $this->assertTrue( count($methods) == 6);
}
/**
* @covers unitTest::unitTest
* @todo Implement testunitTest().
*/
public function testunitTest()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('unitTest', $methods ), 'exists method unitTest' );
$r = new ReflectionMethod('unitTest', 'unitTest');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'ymlFile');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'testLime');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'testDomain');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers unitTest::load
* @todo Implement testload().
*/
public function testload()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('load', $methods ), 'exists method load' );
$r = new ReflectionMethod('unitTest', 'load');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'testName');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'fields');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'Array');
}
/**
* @covers unitTest::runSingle
* @todo Implement testrunSingle().
*/
public function testrunSingle()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('runSingle', $methods ), 'exists method runSingle' );
$r = new ReflectionMethod('unitTest', 'runSingle');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == 'Array');
}
/**
* @covers unitTest::runMultiple
* @todo Implement testrunMultiple().
*/
public function testrunMultiple()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('runMultiple', $methods ), 'exists method runMultiple' );
$r = new ReflectionMethod('unitTest', 'runMultiple');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == 'Array');
$this->assertTrue( $params[1]->getName() == 'count');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '-1');
$this->assertTrue( $params[2]->getName() == 'start');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '0');
}
/**
* @covers unitTest::runAll
* @todo Implement testrunAll().
*/
public function testrunAll()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('runAll', $methods ), 'exists method runAll' );
$r = new ReflectionMethod('unitTest', 'runAll');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == 'Array');
}
/**
* @covers unitTest::sampleTestFunction
* @todo Implement testsampleTestFunction().
*/
public function testsampleTestFunction()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('sampleTestFunction', $methods ), 'exists method sampleTestFunction' );
$r = new ReflectionMethod('unitTest', 'sampleTestFunction');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'testCase');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'Fields');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
}