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
3 changes: 2 additions & 1 deletion library/Zend/Form/Element/DateSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function getDayAttributes()
/**
* @param string|array|\ArrayAccess|PhpDateTime $value
* @throws \Zend\Form\Exception\InvalidArgumentException
* @return void|\Zend\Form\Element
* @return self Provides a fluent interface
*/
public function setValue($value)
{
Expand All @@ -112,6 +112,7 @@ public function setValue($value)
$this->yearElement->setValue($value['year']);
$this->monthElement->setValue($value['month']);
$this->dayElement->setValue($value['day']);
return $this;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docblock of the method should also be modified

}

/**
Expand Down
6 changes: 6 additions & 0 deletions tests/ZendTest/Form/Element/DateSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ public function testConstructAcceptsDayAttributes()
$dayAttributes = $sut->getDayAttributes();
$this->assertEquals('test', $dayAttributes['class']);
}

public function testValueSetterReturnsSameObjectType()
{
$element = new DateSelectElement();
$this->assertSame($element, $element->setValue('2014-01-01'));
}
}