public function testSettingNameSetsNameAttribute() { $element = new Element(); $element->setName('foo'); $this->assertEquals('foo', $element->getAttribute('name')); }
/** * @inheritdoc */ public function setName($name) { return $this->element->setName($name); }
public function testEnsureUseHiddenElementMethodExists() { $element = new Element(); $element->setName('codeType'); $element->setOptions(array('label' => 'Code Type')); $element->setAttributes(array('type' => 'radio', 'options' => array('Markdown' => 'markdown', 'HTML' => 'html', 'Wiki' => 'wiki'), 'value' => array('markdown'))); $markup = $this->helper->render($element); $this->assertNotContains('type="hidden"', $markup); // Lack of error also indicates this test passes }
/** * * @param type $strName * @param type $arrAttributes * @param type $arrOptions * @param ElementZend $objectElement * @return ElementZend|boolean */ private function prepareElementDefault($strName, $arrAttributes, $arrOptions, ElementZend $objectElement) { if (func_num_args() == 1) { $arrElement = $this->getElementDefault(func_get_args()); if (!is_array($arrElement)) { return false; } extract($arrElement); } else { if (empty($arrAttributes)) { $arrAttributes = array(); } if (empty($arrOptions)) { $arrOptions = array(); } } $objectElement->setName($strName)->setOptions($arrOptions)->setAttributes($arrAttributes); return $objectElement; }