From 910d53b63fdc48c430b7fcce3bfb03938355754b Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Fri, 13 Jul 2012 12:01:50 -0400 Subject: [PATCH] BUG 0000 "PHPUNIT instantiation classXmlForm_Field_CheckBoxTableTest.php" SOLVED - Instantiation of the class - Formatting file to PSR2 --- .../classXmlForm_Field_CheckBoxTableTest.php | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/tests/automated/workflow/engine/classes/classXmlForm_Field_CheckBoxTableTest.php b/tests/automated/workflow/engine/classes/classXmlForm_Field_CheckBoxTableTest.php index a8cbf8f71..4dda33906 100644 --- a/tests/automated/workflow/engine/classes/classXmlForm_Field_CheckBoxTableTest.php +++ b/tests/automated/workflow/engine/classes/classXmlForm_Field_CheckBoxTableTest.php @@ -26,7 +26,10 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = new XmlForm_Field_CheckBoxTable(); + $attributes = array("type" => "input"); + $xmlNode = new Xml_Node("node1", "type1", "value1", $attributes); + + $this->object = new XmlForm_Field_CheckBoxTable($xmlNode); } /** @@ -38,12 +41,13 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase } /** - * 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. */ public function testNumberOfMethodsInThisClass() { - $methods = get_class_methods('XmlForm_Field_CheckBoxTable'); $this->assertTrue( count($methods) == 24); + $methods = get_class_methods('XmlForm_Field_CheckBoxTable'); + $this->assertTrue(count($methods) == 24); } /** @@ -53,17 +57,18 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase public function testrender() { $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('XmlForm_Field_CheckBoxTable', 'render'); $params = $r->getParameters(); - $this->assertTrue( $params[0]->getName() == 'value'); - $this->assertTrue( $params[0]->isArray() == false); - $this->assertTrue( $params[0]->isOptional () == true); - $this->assertTrue( $params[0]->getDefaultValue() == ''); - $this->assertTrue( $params[1]->getName() == 'owner'); - $this->assertTrue( $params[1]->isArray() == false); - $this->assertTrue( $params[1]->isOptional () == true); - $this->assertTrue( $params[1]->getDefaultValue() == ''); - } - } + $this->assertTrue($params[0]->getName() == 'value'); + $this->assertTrue($params[0]->isArray() == false); + $this->assertTrue($params[0]->isOptional () == true); + $this->assertTrue($params[0]->getDefaultValue() == ''); + $this->assertTrue($params[1]->getName() == 'owner'); + $this->assertTrue($params[1]->isArray() == false); + $this->assertTrue($params[1]->isOptional () == true); + $this->assertTrue($params[1]->getDefaultValue() == ''); + } +} +