'input'); $fieldNode = new Xml_Node('testField', 'type', 'value', $attributes); $this->object = new XmlForm_Field_JavaScript($fieldNode); } /** * 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('XmlForm_Field_JavaScript'); $this->assertTrue( count($methods) == 26); } /** * @covers XmlForm_Field_JavaScript::XmlForm_Field_JavaScript * @todo Implement testXmlForm_Field_JavaScript(). */ public function testXmlForm_Field_JavaScript() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('XmlForm_Field_JavaScript', $methods ), 'exists method XmlForm_Field_JavaScript' ); $r = new ReflectionMethod('XmlForm_Field_JavaScript', 'XmlForm_Field_JavaScript'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'xmlNode'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'lang'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == 'en'); $this->assertTrue( $params[2]->getName() == 'home'); $this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isOptional () == true); $this->assertTrue( $params[2]->getDefaultValue() == ''); } /** * @covers XmlForm_Field_JavaScript::render * @todo Implement testrender(). */ public function testrender() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('render', $methods ), 'exists method render' ); $r = new ReflectionMethod('XmlForm_Field_JavaScript', '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() == ''); } /** * @covers XmlForm_Field_JavaScript::renderGrid * @todo Implement testrenderGrid(). */ public function testrenderGrid() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('renderGrid', $methods ), 'exists method renderGrid' ); $r = new ReflectionMethod('XmlForm_Field_JavaScript', 'renderGrid'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'value'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); $this->assertTrue( $params[1]->getName() == 'owner'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == false); } /** * @covers XmlForm_Field_JavaScript::validateValue * @todo Implement testvalidateValue(). */ public function testvalidateValue() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('validateValue', $methods ), 'exists method validateValue' ); $r = new ReflectionMethod('XmlForm_Field_JavaScript', 'validateValue'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'value'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == false); } }