Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/Zend/Form/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class Element implements
protected $attributes = array();

/**
* @var string
* @var null|string
*/
protected $label;

/**
* @var array
*/
protected $labelAttributes;
protected $labelAttributes = array();

/**
* @var array Validation error messages
Expand Down Expand Up @@ -308,7 +308,7 @@ public function setLabel($label)
/**
* Retrieve the label used for this element
*
* @return string
* @return null|string
*/
public function getLabel()
{
Expand Down
6 changes: 6 additions & 0 deletions tests/ZendTest/Form/ElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public function testAttributesAreEmptyByDefault()
$this->assertEquals(array(), $element->getAttributes());
}

public function testLabelAttributesAreEmptyByDefault()
{
$element = new Element();
$this->assertEquals(array(), $element->getLabelAttributes());
}

public function testCanAddAttributesSingly()
{
$element = new Element();
Expand Down