Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#5928] Added unit test

- Added unit test for patch; failed prior to applying patch, passes afterwards.
  • Loading branch information...
commit e7db151c13224d23a147337098c25497187f333a 1 parent 1f93594
@weierophinney weierophinney authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/ZendTest/Form/Element/DateTimeSelectTest.php
View
13 tests/ZendTest/Form/Element/DateTimeSelectTest.php
@@ -137,4 +137,17 @@ public function testCloningPreservesCorrectValues()
$this->assertEquals('04', $cloned->getMinuteElement()->getValue());
$this->assertEquals('05', $cloned->getSecondElement()->getValue());
}
+
+ public function testPassingNullValueToSetValueWillUseCurrentDate()
+ {
+ $now = new DateTime;
+ $element = new DateTimeSelectElement();
+ $element->setValue(null);
+ $yearElement = $element->getYearElement();
+ $monthElement = $element->getMonthElement();
+ $dayElement = $element->getDayElement();
+ $this->assertEquals($now->format('Y'), $yearElement->getValue());
+ $this->assertEquals($now->format('m'), $monthElement->getValue());
+ $this->assertEquals($now->format('d'), $dayElement->getValue());
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.