BUG 0000 Adjustment in te class classdynaformEditorTest

- phpunit and phpcs tested in the class classdynaformEditorTest
This commit is contained in:
Hector Cortez
2012-07-13 16:53:59 -04:00
parent 1acff72965
commit f258ac16c1

View File

@@ -1,4 +1,5 @@
<?php <?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.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.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php'; require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
@@ -11,156 +12,158 @@ require_once PATH_TRUNK . 'workflow/engine/classes/class.dynaformEditor.php';
/** /**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:31. * Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:31.
*/ */
class classdynaformEditorTest extends PHPUnit_Framework_TestCase class classdynaformEditorTest extends PHPUnit_Framework_TestCase
{ {
/** /**
* @var dynaformEditor * @var dynaformEditor
*/ */
protected $object; protected $object;
/** /**
* Sets up the fixture, for example, opens a network connection. * Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed. * This method is called before a test is executed.
*/ */
protected function setUp() protected function setUp()
{ {
$this->object = new dynaformEditor(); $this->object = new dynaformEditor('getvalue');
} }
/** /**
* Tears down the fixture, for example, closes a network connection. * Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed. * This method is called after a test is executed.
*/ */
protected function tearDown() protected function tearDown()
{ {
} }
/** /**
* This is the default method to test, if the class still having * This is the default method to test, if the class still having
* the same number of methods. * the same number of methods.
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('dynaformEditor'); $this->assertTrue( count($methods) == 10); $methods = get_class_methods('dynaformEditor');
$this->assertTrue(count($methods) == 10);
} }
/** /**
* @covers dynaformEditor::dynaformEditor * @covers dynaformEditor::dynaformEditor
* @todo Implement testdynaformEditor(). * @todo Implement testdynaformEditor().
*/ */
public function testdynaformEditor() public function testdynaformEditor()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('dynaformEditor', $methods ), 'exists method dynaformEditor' ); $this->assertTrue(in_array('dynaformEditor', $methods), 'exists method dynaformEditor');
$r = new ReflectionMethod('dynaformEditor', 'dynaformEditor'); $r = new ReflectionMethod('dynaformEditor', 'dynaformEditor');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'get'); $this->assertTrue($params[0]->getName() == 'get');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
* @covers dynaformEditor::_createDefaultXmlForm * @covers dynaformEditor::_createDefaultXmlForm
* @todo Implement test_createDefaultXmlForm(). * @todo Implement test_createDefaultXmlForm().
*/ */
public function test_createDefaultXmlForm() public function test_createDefaultXmlForm()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_createDefaultXmlForm', $methods ), 'exists method _createDefaultXmlForm' ); $this->assertTrue(in_array('_createDefaultXmlForm', $methods), 'exists method _createDefaultXmlForm');
$r = new ReflectionMethod('dynaformEditor', '_createDefaultXmlForm'); $r = new ReflectionMethod('dynaformEditor', '_createDefaultXmlForm');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fileName'); $this->assertTrue($params[0]->getName() == 'fileName');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
* @covers dynaformEditor::_render * @covers dynaformEditor::_render
* @todo Implement test_render(). * @todo Implement test_render().
*/ */
public function test_render() public function test_render()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_render', $methods ), 'exists method _render' ); $this->assertTrue(in_array('_render', $methods), 'exists method _render');
$r = new ReflectionMethod('dynaformEditor', '_render'); $r = new ReflectionMethod('dynaformEditor', '_render');
$params = $r->getParameters(); $params = $r->getParameters();
} }
/** /**
* @covers dynaformEditor::_getFilename * @covers dynaformEditor::_getFilename
* @todo Implement test_getFilename(). * @todo Implement test_getFilename().
*/ */
public function test_getFilename() public function test_getFilename()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_getFilename', $methods ), 'exists method _getFilename' ); $this->assertTrue(in_array('_getFilename', $methods), 'exists method _getFilename');
$r = new ReflectionMethod('dynaformEditor', '_getFilename'); $r = new ReflectionMethod('dynaformEditor', '_getFilename');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'file'); $this->assertTrue($params[0]->getName() == 'file');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
* @covers dynaformEditor::_setUseTemporalCopy * @covers dynaformEditor::_setUseTemporalCopy
* @todo Implement test_setUseTemporalCopy(). * @todo Implement test_setUseTemporalCopy().
*/ */
public function test_setUseTemporalCopy() public function test_setUseTemporalCopy()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_setUseTemporalCopy', $methods ), 'exists method _setUseTemporalCopy' ); $this->assertTrue(in_array('_setUseTemporalCopy', $methods), 'exists method _setUseTemporalCopy');
$r = new ReflectionMethod('dynaformEditor', '_setUseTemporalCopy'); $r = new ReflectionMethod('dynaformEditor', '_setUseTemporalCopy');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'onOff'); $this->assertTrue($params[0]->getName() == 'onOff');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
* @covers dynaformEditor::_setTmpData * @covers dynaformEditor::_setTmpData
* @todo Implement test_setTmpData(). * @todo Implement test_setTmpData().
*/ */
public function test_setTmpData() public function test_setTmpData()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_setTmpData', $methods ), 'exists method _setTmpData' ); $this->assertTrue(in_array('_setTmpData', $methods), 'exists method _setTmpData');
$r = new ReflectionMethod('dynaformEditor', '_setTmpData'); $r = new ReflectionMethod('dynaformEditor', '_setTmpData');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'data'); $this->assertTrue($params[0]->getName() == 'data');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
} }
/** /**
* @covers dynaformEditor::_getTmpData * @covers dynaformEditor::_getTmpData
* @todo Implement test_getTmpData(). * @todo Implement test_getTmpData().
*/ */
public function test_getTmpData() public function test_getTmpData()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_getTmpData', $methods ), 'exists method _getTmpData' ); $this->assertTrue(in_array('_getTmpData', $methods), 'exists method _getTmpData');
$r = new ReflectionMethod('dynaformEditor', '_getTmpData'); $r = new ReflectionMethod('dynaformEditor', '_getTmpData');
$params = $r->getParameters(); $params = $r->getParameters();
} }
/** /**
* @covers dynaformEditor::_copyFile * @covers dynaformEditor::_copyFile
* @todo Implement test_copyFile(). * @todo Implement test_copyFile().
*/ */
public function test_copyFile() public function test_copyFile()
{ {
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('_copyFile', $methods ), 'exists method _copyFile' ); $this->assertTrue(in_array('_copyFile', $methods), 'exists method _copyFile');
$r = new ReflectionMethod('dynaformEditor', '_copyFile'); $r = new ReflectionMethod('dynaformEditor', '_copyFile');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'from'); $this->assertTrue($params[0]->getName() == 'from');
$this->assertTrue( $params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue($params[0]->isOptional() == false);
$this->assertTrue( $params[1]->getName() == 'to'); $this->assertTrue($params[1]->getName() == 'to');
$this->assertTrue( $params[1]->isArray() == false); $this->assertTrue($params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false); $this->assertTrue($params[1]->isOptional() == false);
} }
}
}