BUG 0000 "PHPUNIT instantiation classXmlForm_Field_TextareaPMTest.php" SOLVED

- Instantiation of the class
- Formatting file to PSR2
This commit is contained in:
Victor Saisa Lopez
2012-07-13 12:38:20 -04:00
parent ff23d78a6e
commit 9471e800ff

View File

@@ -26,7 +26,10 @@ class classXmlForm_Field_TextareaPMTest extends PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->object = new XmlForm_Field_TextareaPM(); $attributes = array("type" => "input");
$xmlNode = new Xml_Node("node1", "type1", "value1", $attributes);
$this->object = new XmlForm_Field_TextareaPM($xmlNode);
} }
/** /**
@@ -43,7 +46,8 @@ class classXmlForm_Field_TextareaPMTest extends PHPUnit_Framework_TestCase
*/ */
public function testNumberOfMethodsInThisClass() public function testNumberOfMethodsInThisClass()
{ {
$methods = get_class_methods('XmlForm_Field_TextareaPM'); $this->assertTrue( count($methods) == 24); $methods = get_class_methods('XmlForm_Field_TextareaPM');
$this->assertTrue(count($methods) == 24);
} }
/** /**
@@ -73,6 +77,7 @@ class classXmlForm_Field_TextareaPMTest extends PHPUnit_Framework_TestCase
$methods = get_class_methods($this->object); $methods = get_class_methods($this->object);
$this->assertTrue( in_array('renderGrid', $methods ), 'exists method renderGrid' ); $this->assertTrue( in_array('renderGrid', $methods ), 'exists method renderGrid' );
$r = new ReflectionMethod('XmlForm_Field_TextareaPM', 'renderGrid'); $r = new ReflectionMethod('XmlForm_Field_TextareaPM', 'renderGrid');
$params = $r->getParameters(); $params = $r->getParameters();
$this->assertTrue($params[0]->getName() == 'values'); $this->assertTrue($params[0]->getName() == 'values');
$this->assertTrue($params[0]->isArray() == false); $this->assertTrue($params[0]->isArray() == false);
@@ -81,5 +86,5 @@ class classXmlForm_Field_TextareaPMTest extends PHPUnit_Framework_TestCase
$this->assertTrue($params[1]->isArray() == false); $this->assertTrue($params[1]->isArray() == false);
$this->assertTrue($params[1]->isOptional () == false); $this->assertTrue($params[1]->isOptional () == false);
} }
} }