Merge pull request #246 from victorsl/master

BUG 0000 "PHPUNIT instantiation classXmlForm_Field_hoursTest.php" SOLVED
This commit is contained in:
julceslauhub
2012-07-13 09:04:24 -07:00
2 changed files with 30 additions and 21 deletions

View File

@@ -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);
}
/**
@@ -43,7 +46,8 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase
*/
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);
}
/**
@@ -56,6 +60,7 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase
$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);
@@ -65,5 +70,5 @@ class classXmlForm_Field_CheckBoxTableTest extends PHPUnit_Framework_TestCase
$this->assertTrue($params[1]->isOptional () == true);
$this->assertTrue($params[1]->getDefaultValue() == '');
}
}

View File

@@ -26,7 +26,10 @@ class classXmlForm_Field_hoursTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->object = new XmlForm_Field_hours();
$attributes = array("type" => "input");
$xmlNode = new Xml_Node("node1", "type1", "value1", $attributes);
$this->object = new XmlForm_Field_hours($xmlNode);
}
/**
@@ -43,7 +46,8 @@ class classXmlForm_Field_hoursTest extends PHPUnit_Framework_TestCase
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('XmlForm_Field_hours'); $this->assertTrue( count($methods) == 24);
$methods = get_class_methods('XmlForm_Field_hours');
$this->assertTrue(count($methods) == 24);
}
/**
@@ -98,5 +102,5 @@ class classXmlForm_Field_hoursTest extends PHPUnit_Framework_TestCase
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}